summaryrefslogtreecommitdiffstats
path: root/lldb/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [unittests] Disable lldb-server tests if an external debug server is in useVedant Kumar2018-02-241-2/+3
| | | | | | | | | | | | The lldb-server unit tests don't test the right thing when the debug server in use is copied from somewhere else. This can lead to spurious test failures. Disable these unit tests when an external debug server is in use. Fixes llvm.org/PR36494. llvm-svn: 326001
* Add DEBUGSERVER_PATH to the cache so it'll be available for tests.Don Hinton2018-02-171-2/+2
| | | | | | | | This fixed a problem caused by r325442. Differential Revision: https://reviews.llvm.org/D43432 llvm-svn: 325452
* [cmake] Fix LLDB_CODESIGN_IDENTITY logic.Don Hinton2018-02-171-3/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: Consolidate LLDB_CODESIGN_IDENTITY logic in one place and use SKIP_DEBUGSERVER, which can be set independently, to control codesigning targets. Currently, running cmake the first time in a clean directory, without passing -DLLDB_CODESIGN_IDENTITY='', fails. However, subsequent runs succeed. That's because LLDB_CODESIGN_IDENTITY gets added to the CACHE after the initial test. To fix that, the default value must be set before it's tested. Here's the error produced on the first run: CMake Error at tools/lldb/tools/debugserver/source/CMakeLists.txt:215 (add_custom_command): No TARGET 'debugserver' has been created in this directory. Differential Revision: https://reviews.llvm.org/D43432 llvm-svn: 325442
* [cmake] Darwin: Copy in the system debugserver if neededVedant Kumar2018-02-131-1/+9
| | | | | | | This makes the built debugger functional on Darwin when compiling without code signing (as documented in docs/code-signing.txt). llvm-svn: 325068
* Turn off the deprecated ALWAYS_SEARCH_USER_PATHS featureJason Molenda2018-02-031-0/+7
| | | | | | | | in debugserver. This is already set this way in the lldb project files but not in debugserver. Updating for consistency. llvm-svn: 324158
* Make use of physical footprint as memory measurement.Han Ming Ong2018-02-014-339/+19
| | | | | | | | | | | | Remove obsolete measurements. This check in requires at least 10.11 Reviewed: Jason Molenda, Jim Ingham <rdar://problem/37047106> Xcode Memory gauge should show the jetsam ledger footprint rather than anonymous llvm-svn: 324013
* Remove the hardcoded macos deployment targets altogetherJason Molenda2018-01-171-21/+0
| | | | | | | from the xcode project files. We'll build for the current OS only, by default. llvm-svn: 322603
* When parsing the target.xml register file, if no architecture hasJason Molenda2018-01-121-0/+7
| | | | | | | | | | | | | | | | | been specified yet (either by the user, or by one of the lldb extensions like qHostInfo or qProcessInfo), and the target.xml includes a <architecture> tag specifying x86_64, set the architecture appropriately. I'm not sure what we can expect to see in the <architecture> tag, so I'm only doing this for x86_64 right now where I've seen "i386:x86_64" used. I've seen a target.xml from a jtag board that sends just "arm" because it doesn't know more specifically what type of board it is connected to... <rdar://problem/29908970> llvm-svn: 322339
* Add Utility/Environment class for handling... environmentsPavel Labath2018-01-101-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was some confusion in the code about how to represent process environment. Most of the code (ab)used the Args class for this purpose, but some of it used a more basic StringList class instead. In either case, the fact that the underlying abstraction did not provide primitive operations for the typical environment operations meant that even a simple operation like checking for an environment variable value was several lines of code. This patch adds a separate Environment class, which is essentialy a llvm::StringMap<std::string> in disguise. To standard StringMap functionality, it adds a couple of new functions, which are specific to the environment use case: - (most important) envp conversion for passing into execve() and likes. Instead of trying to maintain a constantly up-to-date envp view, it provides a function which creates a envp view on demand, with the expectation that this will be called as the very last thing before handing the value to the system function. - insert(StringRef KeyEqValue) - splits KeyEqValue into (key, value) pair and inserts it into the environment map. - compose(value_type KeyValue) - takes a map entry and converts in back into "KEY=VALUE" representation. With this interface most of the environment-manipulating code becomes one-liners. The only tricky part was maintaining compatibility in SBLaunchInfo, which expects that the environment entries are accessible by index and that the returned const char* is backed by the launch info object (random access into maps is hard and the map stores the entry in a deconstructed form, so we cannot just return a .c_str() value). To solve this, I have the SBLaunchInfo convert the environment into the "envp" form, and use it to answer the environment queries. Extra code is added to make sure the envp version is always in sync. (This also improves the layering situation as Args was in the Interpreter module whereas Environment is in Utility.) Reviewers: zturner, davide, jingham, clayborg Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D41359 llvm-svn: 322174
* This change updates the deployment target for lldb and debugserverJason Molenda2018-01-091-40/+110
| | | | | | | | | | | | | | | | (built with Xcode) from 10.9 to 10.11. It also enables the use of libcompression in debugserver by default (these API are only present in macOS 10.11 and newer -- 10.11 was released c. Sep 2015). I don't know if we have people / bots building lldb on older mac releases; if this turns out to be a problem I will revert the change. There are some parts of lldb (e.g. debugserer's ability to report the OS version #) that only work with 10.10 and this changes the behavior of lldb (whether the older or newer dyld interfaces are used) so there is some importance to updating the min required version. llvm-svn: 322128
* debugserver: Propagate environment in launch-mode (pr35671)Pavel Labath2017-12-223-8/+34
| | | | | | | | | | | | | | | | | | Summary: Make sure we propagate environment when starting debugserver with a pre-loaded inferior. AFAIK, RNBRunLoopLaunchInferior is only called in pre-loaded inferior scenario, so we can just pick up the debugserver environment instead of trying to construct an envp from the (empty) context. This makes debugserver pass an test added for an equivalent lldb-server fix. Reviewers: jasonmolenda, clayborg Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D41352 llvm-svn: 321355
* Replace an accidentally added "break" with an LLVM_FALLTHROUGH.Adrian Prantl2017-12-191-1/+1
| | | | | | Thanks to Greg Clayton for catchting this! llvm-svn: 321123
* Fix a couple of warnings (NFC)Adrian Prantl2017-12-192-2/+5
| | | | llvm-svn: 321120
* Tweak to the debugserver entitlements setup in the xcode projectJason Molenda2017-12-191-22/+12
| | | | | | | file. For macos builds specifically, use the macosx entitlements files; for all other builds, use the ios etc entitlements. llvm-svn: 321051
* llgs: Propagate the environment when launching the inferior from command linePavel Labath2017-12-181-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We were failing to propagate the environment when lldb-server was started with a pre-loaded process (e.g.: lldb-server gdbserver -- inferior --inferior_args) This patch makes sure the environment is propagated. Instead of adding a new GDBRemoteCommunicationServerLLGS::SetLaunchEnvironment function to complement SetLaunchArgs and SetLaunchFlags, I replace these with a more generic SetLaunchInfo, which can be used to set any launch-related property. The accompanying test also verifies that the server correctly terminates the connection after sending the exit packet (specifically, that it does not send the exit packet twice). Reviewers: clayborg, eugene Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D41070 llvm-svn: 320984
* ObjectFileELF: Add support for compressed sectionsPavel Labath2017-12-151-1/+2
| | | | | | | | | | | | | | | | Summary: We use the llvm decompressor to decompress SHF_COMPRESSED sections. This enables us to read data from debug info sections, which are sometimes compressed, particuarly in the split-dwarf case. This functionality is only available if llvm is compiled with zlib support. Reviewers: clayborg, zturner Subscribers: emaste, mgorny, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D40616 llvm-svn: 320813
* Change uses of strncpy in debugserver to strlcpyJason Molenda2017-12-095-15/+15
| | | | | | | | for better safety. <rdar://problem/32906923> llvm-svn: 320242
* [MachException] Avoid alignment UB, NFCVedant Kumar2017-12-082-4/+11
| | | | | | | | | | | Fix alignment UB in some Mach exception-handling logic. This lets us build lldb and debugserver with UBSan in trapping mode, and get further along in the testing process before a trap is encountered. rdar://35923991 llvm-svn: 320127
* Remove extant references to g_message_mutex, NFCVedant Kumar2017-12-081-9/+6
| | | | | | Thanks to Jim Ingham for providing the explanation! llvm-svn: 320126
* [lldb] Use PRIVATE in target_link_librariesShoaib Meenai2017-12-061-1/+1
| | | | | | | | This is a follow-up to r319840. I guess none of the systems I'd tested on before had LLDB_SYSTEM_LIBS set, which is why I didn't see any local errors, but I'm surprised none of the bots caught it either. llvm-svn: 319953
* Fix the -Wunused-function warning properly (MachProcess.mm)Vedant Kumar2017-12-061-1/+1
| | | | | | | r319938 was not NFC, because it got the preprocessor guard wrong. Check WITH_FBS and WITH_BKS before defining SplitEventData. llvm-svn: 319943
* Fix an -Wunused-function warning, NFCVedant Kumar2017-12-061-20/+22
| | | | llvm-svn: 319938
* Fix misc -Wcast-qual warnings, NFCVedant Kumar2017-12-067-22/+29
| | | | llvm-svn: 319937
* Remove no-op function pointer null checks, NFCVedant Kumar2017-12-062-30/+22
| | | | | | | | | | | | | | Null-checking functions which aren't marked weak_import is a no-op (the compiler rewrites the check to 'true'), regardless of whether a library providing its definition is weak-linked. If the deployment target is greater than the minimum requirement, the availability markup on APIs does not lower to weak_import. Remove no-op null checks to clean up the code and silence warnings. Differential Revision: https://reviews.llvm.org/D40812 llvm-svn: 319936
* Add a symbols subcommand to lldb-test.Zachary Turner2017-12-021-1/+28
| | | | | | Differential Revision: https://reviews.llvm.org/D40745 llvm-svn: 319599
* Fix warnings in JSON.cpp, NFCVedant Kumar2017-12-011-3/+0
| | | | | | These asserts are no-ops, and are supplanted by -Wcovered-switch. llvm-svn: 319596
* Fix warnings in DNBDataRef.cpp, NFCVedant Kumar2017-12-011-6/+6
| | | | llvm-svn: 319595
* Add lldb-test.Zachary Turner2017-12-017-0/+650
| | | | | | | | | | | | | | | | | | | | | This is basically a proof-of-concept and starting point for having a testing-centric tool in LLDB. I'm sure this leaves a lot of room to be desired, but this at least allows us to have something to build on. Right now there is only one command, the `module-sections` command, and I created this command not because it was particularly special, but because it addressed an immediate use case and was extremely simple. Run the tool as `lldb-test module-sections <path-to-object>`. Feel free to add testing related stuff to your heart's content after this goes in. Implementing the commands themselves takes some work, but once they're there they can be reused without writing any code and result in very easy to use and maintain tests. Differential Revision: https://reviews.llvm.org/D40636 llvm-svn: 319504
* Recognize another magic token sent in the LaunchInfo's EventData.Jim Ingham2017-11-171-29/+71
| | | | | | <rdar://problem/32505028> llvm-svn: 318496
* Fix LLVM_LINK_LLVM_DYLIB build (pr35053)Pavel Labath2017-10-314-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r316368 broke this build when it introduced a reference to a pthread function to the Utility module. This caused cmake to generate an incorrect link line (wrong order of libs) because it did not see the dependency from Utility to the system libraries. Instead these libraries were being manually added to each final target. This changes moves the dependency management from the individual targets to the lldbUtility module, which is consistent with how llvm does it. The final targets will pick up these libraries as they will be a part of the link interface of the module. Technically, some of these dependencies could go into the host module, as that's where most of the os-specific code is, but I did not try to investigate which ones. Reviewers: zturner, sylvestre.ledru Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D39246 llvm-svn: 316997
* Remove default case from switch.Ted Woodward2017-10-111-2/+4
| | | | | | Add case to handle new event lldb::eBreakpointEventTypeAutoContinueChanged. llvm-svn: 315496
* [lldb-mi] Fix a thinko in my previous commit.Davide Italiano2017-09-301-1/+1
| | | | | | Hopefully this should unbreak the Android buildbot. llvm-svn: 314606
* [lldb-mi] Add a default case to placate GCC with -Werror.Davide Italiano2017-09-301-0/+2
| | | | llvm-svn: 314604
* Add a few missing newlines in lldb-server messagesStephane Sezer2017-09-281-8/+8
| | | | | | | | | | Reviewers: fjricci, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D38373 llvm-svn: 314455
* Use socketpair on all Unix platformsEugene Zemtsov2017-09-251-13/+43
| | | | | | | | | | | | | Using TCP sockets is insecure against local attackers, and possibly against remote attackers too (some vulnerabilities may allow tricking a browser to make a request to localhost). Use socketpair (which is immune to such attacks) on all Unix platforms. Patch by Demi Marie Obenour < demiobenour@gmail.com > Differential Revision: https://reviews.llvm.org/D33213 llvm-svn: 314127
* Fix the SIGINT handlersAdrian McCarthy2017-09-202-9/+9
| | | | | | | | | | | | | | | | | 1. Fix a data race (g_interrupt_sent flag usage was not thread safe, signals can be handled on arbitrary threads) 2. exit() is not signal-safe, replaced it with the signal-safe equivalent _exit() (This differs from the patch on Phabrictor because I had to add `#include <atomic>` to get the definition of `std::atomic_flag`.) patch by lemo Differential Revision: https://reviews.llvm.org/D37926 llvm-svn: 313785
* [CMake] Need to set WITH_LOCKDOWN on debugserver targetChris Bieneman2017-09-061-0/+5
| | | | | | | | | | Turns out WITH_LOCKDOWN define changes the struct layout and constructor implementation for RNBSocket which is used in debugserver.cpp, so we need to make sure this is consistent. In the future we should change WITH_LOCKDOWN to be configured in a generated header, but for now we can just set it correctly. <rdar://problem/33900552> llvm-svn: 312666
* lldb-mi: -var-update can hang when traversing complex types with pointersTed Woodward2017-08-311-7/+7
| | | | | | | | | | | | | | | | | | | Summary: -var-update calls CMICmdCmdVarUpdate::ExamineSBValueForChange to check if a varObj has been updated. It checks that the varObj is updated, then recurses on all of its children. If a child is a pointer pointing back to a parent node, this will result in an infinite loop, and lldb-mi hanging. The problem is exposed by packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py, but this test is skipped everywhere. This patch changes ExamineSBValueForChange to not traverse children of varObjs that are pointers. Reviewers: ki.stfu, zturner, clayborg, abidh Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D37154 llvm-svn: 312270
* Change the ftag x87 register from being 8-bits wide to 16-bits wideJason Molenda2017-08-242-8/+8
| | | | | | | | to match the changes Saleem Abdulrasool committed in r311579. Fixes a testsuite failure now that the testsuite expects a 16 bit return value for thsi reg. llvm-svn: 311627
* lldb-argdumper doesn't need lldbCore.Bruce Mitchener2017-08-211-1/+0
| | | | | | | | | | | | Summary: lldb-argdumper only needs lldbUtility to successfully build and link. Reviewers: beanz, zturner, labath Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D36948 llvm-svn: 311399
* Fix typo in variable name.Lang Hames2017-08-161-1/+1
| | | | llvm-svn: 310984
* [CMake] Fixing an error in STREQUAL usage.Chris Bieneman2017-08-151-1/+1
| | | | llvm-svn: 310955
* [CMake] Disable code sign entitlements when using lldb_codesignChris Bieneman2017-08-151-2/+11
| | | | | | Turns out self-signed certificates and entitlements don't always play well together... llvm-svn: 310936
* Checking in files accidentally missed in later diffs of revision r310261Abhishek Aggarwal2017-08-082-0/+596
| | | | | | | | | | -- 2 files were missing in this commit which should have been there. These files were submitted initially for review and were reviewed. However, while updating the revision with newer diffs, I accidentally forgot to include them in newer diffs. So commiting now. llvm-svn: 310341
* Fixed build failure for revision r310261Abhishek Aggarwal2017-08-071-0/+6
| | | | | | -- Was failing for Linux llvm-svn: 310270
* Fixed build failure for revision r310261Abhishek Aggarwal2017-08-071-0/+4
| | | | | | -- Build was failing for freebsd llvm-svn: 310266
* Tool for using Intel(R) Processor Trace hardware featureAbhishek Aggarwal2017-08-0723-35/+2492
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: 1. Provide single library for all Intel specific hardware features instead of individual libraries for each feature 2. Added Intel(R) Processor Trace hardware feature in this single library. Details about the tool implementing this feature is as follows: Tool developed on top of LLDB to provide its users the execution trace of the debugged inferiors. Tool's API are exposed as C++ object oriented interface in a shared library. API are designed especially to be easily integrable with IDEs providing LLDB as an application debugger. Entire API is also available as Python functions through a script bridging interface allowing development of python modules. This patch also provides a CLI wrapper to use the Tool through LLDB's command line. Highlights of the Tool and the wrapper are given below: ****************************** Intel(R) Processor Trace Tool: ****************************** - Provides execution trace of the debugged application - Uses Intel(R) Processor Trace hardware feature (already implemented inside LLDB) for this purpose -- Collects trace packets generated by this feature from LLDB, decodes and post-processes them -- Constructs the execution trace of the application -- Presents execution trace as a list of assembly instructions - Provides 4 APIs (exposed as C++ object oriented interface) -- start trace with configuration options for a thread/process, -- stop trace for a thread/process, -- get the execution flow (assembly instructions) for a thread, -- get trace specific information for a thread - Easily integrable into IDEs providing LLDB as application debugger - Entire API available as Python functions through script bridging interface -- Allows developing python apps on top of Tool - README_TOOL.txt provides more details about the Tool, its dependencies, building steps and API usage - Tool ready to use through LLDB's command line -- CLI wrapper has been developed on top of the Tool for this purpose ********************************* CLI wrapper: cli-wrapper-pt.cpp ********************************* - Provides 4 commands (syntax similar to LLDB's CLI commands): -- processor-trace start -- processor-trace stop -- processor-trace show-trace-options -- processor-trace show-instr-log - README_CLI.txt provides more details about commands and their options Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: clayborg, jingham, lldb-commits, labath Reviewed By: clayborg Subscribers: ravitheja, emaste, krytarowski, mgorny Differential Revision: https://reviews.llvm.org/D33035 llvm-svn: 310261
* [CMake] debugserver-nonui doesn't go in the frameworkChris Bieneman2017-07-281-1/+1
| | | | | | Small change to correct the install path of the nonui debugserver. llvm-svn: 309428
* [CMake] libcompression is optional not required for debugserverChris Bieneman2017-07-281-2/+6
| | | | | | Fix a quick bug from r309395. llvm-svn: 309396
* [CMake] Add checks for libcompressionChris Bieneman2017-07-281-5/+17
| | | | | | This enables libcompression when available in the CMake build system. llvm-svn: 309395
OpenPOWER on IntegriCloud