summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Change PlatformPosix::DoLoadImage to use a UtilityFunction.Jim Ingham2018-04-174-50/+321
| | | | | | | | | | | That way we won't have to compile a new expression every time we want dlopen a library. <rdar://problem/32626584> Differential Revision: https://reviews.llvm.org/D45703 llvm-svn: 330214
* Fix the xcode project for the Args -> Utility move.Jim Ingham2018-04-171-6/+6
| | | | llvm-svn: 330211
* Move Args.cpp from Interpreter to UtilityPavel Labath2018-04-1752-74/+61
| | | | | | | | | | | | | | | | | | | | | Summary: The Args class is used in plenty of places besides the command interpreter (e.g., anything requiring an argc+argv combo, such as when launching a process), so it needs to be in a lower layer. Now that the class has no external dependencies, it can be moved down to the Utility module. This removes the last (direct) dependency from the Host module to Interpreter, so I remove the Interpreter module from Host's dependency list. Reviewers: zturner, jingham, davide Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D45480 llvm-svn: 330200
* [Statistics] Relax the test output a little bit.Davide Italiano2018-04-161-4/+4
| | | | | | | | | | We don't really care about the order as this is a dictionary. It should be more resilient to changes (adding/shuffling stats around). Pointed out by Jason Molenda in a post-commit review (thanks Jason). llvm-svn: 330170
* [Commands] Expose statistics through the SBAPI.Davide Italiano2018-04-167-0/+60
| | | | | | | | | The API is `SBStructuredData GetStatistics()`. This allows the command to be used in scripts. <rdar://problem/36555975> llvm-svn: 330165
* Make sure deleting all breakpoints clears their sites firstEugene Zemtsov2018-04-163-5/+30
| | | | | | | | Bug: https://bugs.llvm.org/show_bug.cgi?id=36430 Differential Revision: https://reviews.llvm.org/D45554 llvm-svn: 330163
* [lldb-private] Mark a function as inline to prevent multiple def errors.Davide Italiano2018-04-161-1/+1
| | | | llvm-svn: 330149
* [Statistics] Move GetStatDescription to an header file.Davide Italiano2018-04-162-18/+18
| | | | | | | | In preparation for using it in the API. <rdar://problem/36555975> llvm-svn: 330147
* Reapply "Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding ↵Jan Kratochvil2018-04-148-828/+569
| | | | | | | | | | | | | | DWARFTypeUnit". This patch by Greg Clayton drops the virtualization for DWARFPartialUnit. The virtualization of DWARFUnit now matches more its LLVM counterpart. DWZ patchset is going to be implementable without DWARFPartialUnit remapping. https://reviews.llvm.org/D40474 This reverts commit 329423. This reapplies commit r329305. llvm-svn: 330084
* Revert "[debugserver] Remove dead function call. NFCI."Davide Italiano2018-04-131-0/+3
| | | | | | | This reverts commit r330066 as it was wrong and the call was not dead. Thanks to Fred for pointing this out. llvm-svn: 330071
* [debugserver] Remove dead function call. NFCI.Davide Italiano2018-04-131-3/+0
| | | | llvm-svn: 330066
* [Command] Simplify the code and make it less error prone. NFCI.Davide Italiano2018-04-132-7/+2
| | | | | | Pointed out by Jim. llvm-svn: 330047
* [Command] Implement `statistics` command.Davide Italiano2018-04-1311-24/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to collect useful metrics about lldb debugging sessions. I thought that an example would be better than a thousand words: Process 19705 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step in frame #0: 0x0000000100000fb4 blah`main at blah.c:3 1 int main(void) { 2 int a = 6; -> 3 return 0; 4 } (lldb) statistics enable (lldb) frame var a (int) a = 6 (lldb) expr a (int) $1 = 6 (lldb) statistics disable (lldb) statistics dump Number of expr evaluation successes : 1 Number of expr evaluation failures : 0 Number of frame var successes : 1 Number of frame var failures : 0 Future improvements might include: 1. Passing a file, or implementing categories. The way this patch has been implemented is generic enough to allow this to be extended easily without breaking the grammar. 2. Adding an SBAPI and Python API for use in scripts. Thanks to Jim Ingham for discussing the design with me. <rdar://problem/36555975> Differential Revision: https://reviews.llvm.org/D45547 llvm-svn: 330043
* Allow relative file paths when settings source breakpointsGreg Clayton2018-04-134-7/+56
| | | | | | | | | | | | | | | | | Many IDEs set breakpoints using absolute paths and this causes problems when the full path of the source file path doesn't match what is in the debug info. This can be due to different build systems and do or do not resolve symlinks. This patch allows relative breakpoint to be set correctly without needing to do any target.source-map tricks. If IDEs want to, they can send down relative paths like: ./main.c ./src/main.c src/main.c foo/bar/src/main.c I used the breakpoint resolver to match on the file basename and then we weed out anything whose relative paths don't match. This will be a huge improvement for IDEs as they can specify as much of a relative path as desired to uniquely identify a source file in the current project. Differential Revision: https://reviews.llvm.org/D45592 llvm-svn: 330028
* Re-land "Don't assume backing thread shares protocol ID."Jonas Devlieghere2018-04-135-4/+114
| | | | | | | | | | | | | | | | | | When we're dealing with virtual (memory) threads created by the OS plugins, there's no guarantee that the real thread and the backing thread share a protocol ID. Instead, we should iterate over the memory threads to find the virtual thread that is backed by the current real thread. Differential revision: https://reviews.llvm.org/D45497 rdar://36485830 The original revision (r329891) was reverted because the associated tests ran into a deadlock on the Linux bots. That problem was resolved by r330002. llvm-svn: 330005
* Prevent deadlock in OS PluginsJonas Devlieghere2018-04-131-32/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When performing a synchronous resume, the API mutex is held until the process is stopped. This is fine, except for when the OS plugins are processing an event before the main thread is aware of it, in which case we end up with a deadlock because in the internal thread we acquire a resource lock first, and then wait for the API lock, while in the main thread we do the opposite, we already hold the API mutex but are now waiting for the event mutex to handle the event. This patch fixes this by relaxing the need for the API lock in the OS plugins. We can get away with this because we now this code is executed in the main thread. As stated in the comment above, we just want to ensure nobody else messes with the API while we're making a change. In theory it's possible that the main thread would release the lock while we're executing the function, but prevent this would require a more structural solution (which we want, but do not have today). The same workaround was already present, but this patch generalizes it to the whole file. This will allow me to re-land r329891. Reviewers: clayborg, jingham, labath Subscribers: llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D45586 llvm-svn: 330002
* [docs] Add LLDB_TEST_USE_CUSTOM_C_COMPILER and ↵Aaron Smith2018-04-122-2/+5
| | | | | | LLDB_TEST_USE_CUSTOM_CXX_COMPILER to the build and test hmtl pages llvm-svn: 329971
* Revert "Don't assume backing thread shares protocol ID."Jonas Devlieghere2018-04-125-114/+4
| | | | | | | This reverts r329891 because the test case is timing out on linux: http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/21834 llvm-svn: 329897
* Don't assume backing thread shares protocol ID.Jonas Devlieghere2018-04-125-4/+114
| | | | | | | | | | | | | | When we're dealing with virtual (memory) threads created by the OS plugins, there's no guarantee that the real thread and the backing thread share a protocol ID. Instead, we should iterate over the memory threads to find the virtual thread that is backed by the current real thread. Differential revision: https://reviews.llvm.org/D45497 rdar://36485830 llvm-svn: 329891
* [dotest] Fix syntax error and typo.Jonas Devlieghere2018-04-122-2/+2
| | | | | | Python uses `elif` rather than `else if`. Fixes r329889. llvm-svn: 329890
* [dotest] Use in-tree dsymutil on DarwinJonas Devlieghere2018-04-124-3/+12
| | | | | | | | | | | | | | | | | | | Summary: With the upstream implementation of dsymutil containing almost all functionality from the one shipped with Xcode, we want to use the in-tree version for running the test suite. This will also allow us to re-enable TestUnicodeSymbols which was failing because of the discrepancy in how Unicode symbols were hashed in lldb and older versions of dsymutil. Reviewers: aprantl, davide, jingham, labath Subscribers: mgorny, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D45518 llvm-svn: 329889
* Fix a thinko in CommandObjectMemoryRegion.Jim Ingham2018-04-111-1/+1
| | | | | | | Don't try to read the first argument till you've checked that there is one. llvm-svn: 329844
* [Target] Remove dead/commented out code. NFC.Davide Italiano2018-04-111-16/+0
| | | | | | Some spring cleaning before I touch this file more extensively. llvm-svn: 329831
* llgs: Send "rich" errors in response to vAttach packetsPavel Labath2018-04-114-11/+29
| | | | | | | | | | | | | | | | | There are plenty of ways attaching can go wrong. Having the server report the exact error means we can give better feedback to the user. (This patch does not do the second part, it only makes sure the information is sent from the server.) Triggering all possible error conditions in a test would prove challenging, but there is one error that is very easy to reproduce (attempting to attach while debugging), so I write a test based on that. The test immediately exposed a bug where the m_send_error_strings field was being used uninitialized (so it was sometimes true from the get-go), so I fix that as well. llvm-svn: 329803
* Convert an absolute to a group relative reference for TestOptionArgParser.cpp.Jim Ingham2018-04-101-1/+1
| | | | llvm-svn: 329745
* Fix a typo in the gtest build target for Debug configuration.Jim Ingham2018-04-102-4/+1
| | | | | | I usually run DebugClang... llvm-svn: 329727
* Fix the Xcode build for the addition of OptionArgsParser.Jim Ingham2018-04-102-5/+18
| | | | llvm-svn: 329722
* s/LLVM_ON_WIN32/_WIN32/, lldbNico Weber2018-04-1013-21/+19
| | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. llvm-svn: 329697
* Args: replace isprint8 usage with isprintPavel Labath2018-04-101-2/+1
| | | | | | | | | | | | | It looks like we introduced isprint8 way back in r169417 to be used on getopt's short_options, which we sometimes set to values which are out of range for normal chars to indicate options with no short form. However, this is not how the function is used in the Args class, where we explicitly process a string character by character. This removes the last external dependency from the Args class. llvm-svn: 329682
* Move OptionElementVector helper structs from Args to OptionsPavel Labath2018-04-103-16/+17
| | | | | | | | | | | These are not used anywhere in the Args class. They should have been moved as a part of r327110 (Moving Option parsing from Args to Options), but I did not notice them then. This does not affect the layering in any way, but in makes sense for the structs to be defined in the near the code that uses them. llvm-svn: 329679
* Move Args::StringTo*** functions to a new OptionArgParser classPavel Labath2018-04-1035-454/+555
| | | | | | | | | | | | | | | | Summary: The idea behind this is to move the functionality which depend on other lldb classes into a separate class. This way, the Args class can be turned into a lightweight arc+argv wrapper and moved into the lower lldb layers. Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D44306 llvm-svn: 329677
* Fix compilation error caused by tgmath.h.Tatyana Krasnukha2018-04-091-1/+1
| | | | | | On CentOS calling functions from <tgmath.h> produces multiple errors "'void*' is not a pointer-to-object type". llvm-svn: 329597
* [lldb-server] Set a more generous timeout when testing gdbremote.Davide Italiano2018-04-061-1/+1
| | | | | | | One of our downstream bot is struggling under load, but this value should be enough for everyone. llvm-svn: 329426
* Revert "Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding ↵Jan Kratochvil2018-04-068-569/+828
| | | | | | | | | | | | | | | | | DWARFTypeUnit" The reverted commit changed DWARFUnit from https://reviews.llvm.org/D40466 and https://reviews.llvm.org/D42892 that was prepared for DWARFPartialUnit and made from it a superclass for DWARFTypeUnit. DWARFUnit's intention was: DWARFUnit->DWARFSomeNameUnit->DWARFCompileUnit DWARFUnit->DWARFSomeNameUnit->DWARFTypeUnit DWARFUnit->DWARFPartialUnit Discussed at: https://reviews.llvm.org/D45170 This reverts commit r329305. llvm-svn: 329423
* [debugserver] Fix LC_BUILD_VERSION load command handling.Frederic Riss2018-04-068-169/+246
| | | | | | | | | | | | | | | | | | | | | | Summary: In one of the 2 places the LC_BUILD_VERSION load command is handled, there is a bug preventing us from actually handling them (the address where to read the load command was not updated). This patch factors reading the deployment target load commands into a helper and adds testing for the 2 code paths calling the helper. The testing is a little bit complicated because the only times those load commands matter is when debugging a simulator process. I added a new decorator to check that a specific SDK is available. The actual testing was fairly easy once I knew how to run a simulated process. Reviewers: jasonmolenda, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D45298 llvm-svn: 329374
* [dotest] --skip-category should append and not override.Davide Italiano2018-04-051-1/+1
| | | | | | <rdar://problem/38566150> llvm-svn: 329358
* One more windows build fixPavel Labath2018-04-051-0/+1
| | | | llvm-svn: 329314
* Fix windows build after r329296Pavel Labath2018-04-052-0/+2
| | | | | | Add a couple of #include <csignal>s. llvm-svn: 329309
* Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding DWARFTypeUnitGreg Clayton2018-04-058-828/+569
| | | | | | | | Many things that were in DWARFCompileUnit actually need to be in DWARFUnit. This patch moves all DWARFUnit specific things over into DWARFUnit and fixes the layering. This is in preparation for adding DWARFTypeUnit for the .debug_types patch. Differential Revision: https://reviews.llvm.org/D45170 llvm-svn: 329305
* Remove unused NativeProcessProtocol.h include from Platform.hPavel Labath2018-04-052-4/+1
| | | | | | | | | | | | After removing it, I got a couple of compile errors because we were missing some symbols (SIGKILL and such), as their definitions were not transitively included anymore. I fix this by including csignal from PosixApi.h, as it's windows version provides a stub definitions of these symbols. This should make the result of #including PosixApi.h more consistent across platforms (although in the long run, we should just get rid of this header). llvm-svn: 329296
* Fix error in QEnableErrorStrings gdb-remote docsPavel Labath2018-04-051-1/+1
| | | | | | | this probably happened because we changed the name of the packet mid-review. llvm-svn: 329295
* Added a BSD archive tool.Greg Clayton2018-04-021-0/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination stand alone BSD archive tool that can dump BSD archives: % bsd.py /path/to/foo.a Search archives for an object file: % bsd.py --object foo.o bar.a Dump the symbol definitions found in the __.SYMDEF objects: % bsd.py --symdef bar.a Find symbols by name that are listed in the __.SYMDEF objects: % bsd.py --symbol _Z123 bar.a Extract objects from BSD archives: % bsd.py --object foo.o bar.a --extract % bsd.py --object foo.o bar.a --extract --outfile /tmp/foo.o % bsd.py --object foo.o bar.a --extract --mtime 0x1234556 It also has installs a new LLDB command line command when imported into LLDB: (lldb) command script import ~/Dropbox/bin/bsd.py The "verify-debug-map-objects" command has been installed, type "help verify-debug-map-objects" for detailed help. (lldb) verify-debug-map-objects a.out This will iterate through all object files and verify the modification times match for any .o files, it will verify any .o files from BSD archives are found and have matching modification times and print out errors if any are found. llvm-svn: 328990
* [Core] Grab-bag of improvements for Scalar.Davide Italiano2018-04-023-332/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove Scalar::Cast. It was noted on the list that this method is unused. So, this patch removes it. Fix Scalar::Promote for most integer types This fixes promotion of most integer types (128- and 256-bit types are handled in a subsequent patch) to floating-point types. Previously promotion was done bitwise, where value preservation is correct. Fix Scalar::Promote for 128- and 256-bit integer types This patch fixes the behavior of Scalar::Promote when trying to perform a binary operation involving a 128- or 256-bit integer type and a floating-point type. Now, the integer is cast to the floating point type for the operation. Patch by Tom Tromey! Differential Revision: https://reviews.llvm.org/D44907 llvm-svn: 328985
* Support template template parametersFrederic Riss2018-04-025-2/+78
| | | | | | | | | | | | | | | | | | Summary: We would fail to resolve (and thus display the value of) any templated type which contained a template template argument even though we don't really use template arguments. This patch adds minimal support for template template arguments, but I doubt we need any more than that. Reviewers: clayborg, jingham Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D44613 llvm-svn: 328984
* [test] Exit lldb-dotest in a more Pythonic way.Jonas Devlieghere2018-04-021-4/+2
| | | | | | | As suggested by Keith Smiley in: https://github.com/apple/swift-lldb/pull/486 llvm-svn: 328966
* [lldb-dotest] Don't swallow error exit codes.Davide Italiano2018-03-301-1/+3
| | | | llvm-svn: 328894
* NativeThreadProtocol: delete dead codePavel Labath2018-03-292-41/+0
| | | | | | | | | | | | These functions were unused as everyone just went straight for the direct operations on the register context. In fact, the Save/RestoreAllRegisters actually appear to be wrong (inverted). Thanks to Tatyana for pointing this out. These functions are not very useful now that we can guarantee that each thread always contains a valid register context, so I just delete them. llvm-svn: 328770
* Prevent double release of mach portsFrederic Riss2018-03-292-4/+0
| | | | | | | | | | | | | | | | Summary: When a MIG routine returns KERN_FAILURE, the demux function will release any OOL resources like ports. In this case, task_port and thread_port will be released twice, potentially resulting in use after free of the ports. I don't think we can test this in any useful way rdar://problem/37331387 Reviewers: jasonmolenda Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D45011 llvm-svn: 328761
* Revert r328715. Wasn't wrong, just not the issue.Jim Ingham2018-03-281-1/+0
| | | | llvm-svn: 328721
* Explicitly import subprocessJim Ingham2018-03-281-0/+1
| | | | | | | For some reason on one of our bots subprocess wasn't already imported. Do so explicitly. llvm-svn: 328715
OpenPOWER on IntegriCloud