summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce support for Debug Registers in RegisterContextNetBSD_x86_64Kamil Rytarowski2017-02-241-268/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD 7.99.62 introduced Debug Registers interface similar to the FreeBSD one. This interface will land NetBSD-8.0. Introduce support for this interface in Register Context NetBSD x86_64 unconditionally as older versions of NetBSD will not be supported. This change allows to reduce diff with other ports and remove local copy of the RegisterInfos_x86_64.h content. NetBSD Register Context for 32-bit x86 support will be added later. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D30287 llvm-svn: 296071
* Switch "windows" log channel to the new registration mechanismPavel Labath2017-02-232-159/+17
| | | | llvm-svn: 295968
* Switch "posix" to the new log channel registration mechanismPavel Labath2017-02-233-205/+22
| | | | | | | | | | | | | | | | | | Summary: This also removes magic rename code, which caused the channel to be called "linux" when built on a linux machine, and "freebsd" when built on a freebsd one, which seems unnecessary - registering a new channel is sufficiently simple now that if we wish to log something extremely os-specific, we can just create a new channel. None of the current categories seem very specific to one OS or another. Reviewers: emaste, krytarowski Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30250 llvm-svn: 295954
* Ensure lldb-server waits for child debug servers to start up when passing ↵Howard Hellyer2017-02-231-7/+16
| | | | | | | | | | | | | | | | | | | | | | them a port number to listen on. Summary: When lldb-server is started with the -P <port> or -m/-M <min/max port> options to specify which ports are available for remote connections the child debug server is told what port it should listen on. In those cases lldb-server needs to wait for the child to report it’s port number as otherwise it can tell the lldb client that the child is up and listening before it is actually listening on that port. lldb-server already waits in the cases where a port wasn’t specified by waiting until the child reports the port it is using. It was skipping this synchronisation step when passed a port numbers as it knew what the port would be however it does need to ensure the child process has had time to open that port and waiting until the child reports the port number makes sure this has happened. This patch just removes the one case where a child was spawned and lldb-server did not wait for it to report it’s port number before telling the client lldb process the child is ready to connect to. This issue was discussed on lldb-dev in a thread here: http://lists.llvm.org/pipermail/lldb-dev/2017-February/012002.html Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30255 llvm-svn: 295947
* Replace WINLOG_*** macros with LLDB_LOGPavel Labath2017-02-226-374/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main difference here is that in the WINLOG macros you can specify log categories per call, whereas here you have to go the usual lldb route of getting a Log* variable first. While this means you have to write at least two statements, it usually means that each statement will fit on a single line, whereas fitting the WINLOG invocation on a single line was almost impossible. So the total size of code does not increase even in functions with a single log statement, and functions with more logging get shorter. The downside here is reduced flexibility in specifying the log categories, which a couple of functions used quite heavily (e.g. RefreshStateAfterStop). For these I chose a single category used most prominently and put everything into that, although a solution with multiple log variables is definitely possible. Reviewers: zturner, amccarth Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30172 llvm-svn: 295822
* Fix a couple of corner cases in NameMatchesPavel Labath2017-02-202-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I originally set out to move the NameMatches closer to the relevant function and add some unit tests. However, in the process I've found a couple of bugs in the implementation: - the early exits where not always correct: - (test==pattern) does not mean the match will always suceed because of regular expressions - pattern.empty() does not mean the match will fail because the "" is a valid prefix of any string So I cleaned up those and added some tests. The only tricky part here was that regcomp() implementation on darwin did not recognise the empty string as a regular expression and returned an REG_EMPTY error instead. The simples fix here seemed to be to replace the empty expression with an equivalent non-empty one. Reviewers: clayborg, zturner Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D30094 llvm-svn: 295651
* NPL: Fix an incorrect logging formatv callPavel Labath2017-02-171-2/+2
| | | | llvm-svn: 295457
* Switch GDBRemoteLog to the new registration mechanismPavel Labath2017-02-173-213/+32
| | | | llvm-svn: 295455
* Switch ProcessKDPLog to the new channel registration mechanismPavel Labath2017-02-174-203/+35
| | | | llvm-svn: 295450
* Fix compiler warnings for missing switch cases in lldb.Pavel Labath2017-02-171-0/+5
| | | | | | | | | | | | | | | | | | | Summary: There have been a few new values added to a few LLVM enums this change makes sure that LLDB code handles them correctly. Reviewers: labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30005 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 295445
* NPL: Fix one more bug in the single step workaroundPavel Labath2017-02-172-2/+9
| | | | | | | | | | | | | | | | | In the case we are stepping over the thread creation instruction, we will end up calling Thread::SingleStep back-to-back twice (because of the intermediate PTRACE_EVENT_CLONE stop). This will cause the cpu mask to be set inappropriately (because the old SingleStepCheck object will be destroyed after we create the new one), and the single-step will fail. Before the refactor the code was still incorrect in this case, but in a different way (the thread was left with the incorrect mask after the stepping was complete), so this was not easy to spot. This fixes TestCreateDuringInstructionStep on the affected devices. llvm-svn: 295440
* Finish breaking the dependency from Utility.Zachary Turner2017-02-165-5/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D29964 llvm-svn: 295368
* NPL: Fix single step workaroundPavel Labath2017-02-163-10/+13
| | | | | | | | | | | | While refactoring the code in r293046 I made a very basic error - relying on destructor side-effects of a copyable object. Fix that and make the object non-copyable. This fixes the tests on the platforms that need this workaround, but unfortunately we don't have a way to make a more platform-agnostic test right now. llvm-svn: 295345
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-1413-14/+14
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Before returning a pc value for a stack frame,Jason Molenda2017-02-141-3/+21
| | | | | | | run it through the ABI's FixCodeAddress method. <rdar://problem/29711506> llvm-svn: 295025
* Try to fix windows build (broken by r294939)Pavel Labath2017-02-132-6/+2
| | | | | | log->Debug is gone, switch to using log->Verbose llvm-svn: 294944
* Remove some dead code from ProcessPOSIXLogPavel Labath2017-02-132-41/+0
| | | | llvm-svn: 294940
* Really fix windows buildPavel Labath2017-02-101-2/+2
| | | | | | this time I have actually tried that it compiles on windows. llvm-svn: 294744
* Fix darwin and windows builds broken by r294736Pavel Labath2017-02-104-11/+14
| | | | | | Update the platform-specific log classes to match the new interface. llvm-svn: 294743
* UriParser cleanupPavel Labath2017-02-102-2/+2
| | | | | | | - move the header file to the include folder - enclose the class in the proper namespace llvm-svn: 294741
* Switch TestPacketSpeedJSON to use the llvm chrono formatterPavel Labath2017-02-101-25/+18
| | | | llvm-svn: 294739
* Add a format_provider for the Timeout classPavel Labath2017-02-101-3/+2
| | | | | | | | | | and use it in the appropriate log statements. Formatting of chrono types in log messages was very clunky. This should make it much nicer to use and give better output. For details of the formatting options see the chrono formatter in llvm. llvm-svn: 294738
* Convert Log class to llvm streamsPavel Labath2017-02-104-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This converts LLDB's logging to use llvm streams instead of lldb_private::Stream and friends. The changes are mostly straight-forward and amount to s/lldb_private::Stream/llvm::raw_ostream. The part worth calling out is the rewrite of the StreamCallback class. Previously this class contained a per-thread buffer of data written. I assume this had something to do with it trying to make sure each log line is delivered as a single event, instead of multiple (possibly interleaved) events. However, this is no longer relevant as the Log class already writes things to a temporary buffer and then delivers the message as a single "write", so I have just removed the code in question. Reviewers: zturner, clayborg Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D29615 llvm-svn: 294736
* [CMake] Final dependency cleanup patch!Chris Bieneman2017-02-082-1/+3
| | | | | | | | | | | | | | | | | Summary: This patch removes the over-specified dependencies from LLDBDependencies and instead relies on the dependencies as expressed in each library and tool. This also removes the library looping in favor of allowing CMake to do its thing. I've tested this patch on Darwin, and found no issues, but since linker semantics vary by system I'll also work on testing it on other platforms too. Help testing would be greatly appreciated. Reviewers: labath, zturner Subscribers: danalbert, srhines, mgorny, jgosnell, lldb-commits Differential Revision: https://reviews.llvm.org/D29352 llvm-svn: 294515
* Remove verbose category in the kdp channelPavel Labath2017-02-064-14/+7
| | | | llvm-svn: 294244
* Remove the verbose category in the gdb-remote channelPavel Labath2017-02-064-26/+12
| | | | | | replace by LLDB_LOGV llvm-svn: 294224
* Remove the verbose category in the posix channelPavel Labath2017-02-065-29/+15
| | | | | | replace by LLDB_LOGV llvm-svn: 294223
* Fix missing include in NativeProcessLinuxPavel Labath2017-02-061-7/+4
| | | | llvm-svn: 294211
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-0612-24/+40
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
* Use LLDB_LOG in NativeRegisterContextLinux*** filesPavel Labath2017-02-034-182/+79
| | | | llvm-svn: 294023
* Move classes from Core -> Utility.Zachary Turner2017-02-0244-55/+55
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* Break some dependencies in lldbUtility.Zachary Turner2017-02-011-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D29359 llvm-svn: 293806
* Transform ProcessLauncherLinux to ProcessLauncherPosixForkKamil Rytarowski2017-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use ProcessLauncherPosixFork in Linux and NetBSD. Changes to ProcessLauncherLinux: - Limit personality.h and ASLR code to Linux. - Reuse portable ptrace(2) PT_TRACE_ME operation available on Linux and BSDs. - Limit ETXTBSY error path from execve(2) to Linux. - In LaunchProcess declaration change virtual to override. This code should be readily available for FreeBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, clayborg, labath, emaste Reviewed By: labath Subscribers: danalbert, srhines, mgorny, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29347 llvm-svn: 293768
* Open ELF core dumps with more than 64K sectionsPavel Labath2017-01-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Problem: There are three filelds in the ELF header - e_phnum, e_shnum, and e_shstrndx - that could be bigger than 64K and therefore do not fit in 16 bits reserved for them in the header. If this happens, pretty often there is a special section at index 0 which contains their real values for these fields in the section header in the fields sh_info, sh_size, and sh_link respectively. Fix: - Rename original fields in the header declaration. We want to have them around just in case. - Reintroduce these fields as 32-bit members at the end of the header. By default they are initialized from the header in Parse() method. - In Parse(), detect the situation when the header might have been extended into section info #0 and try to read it from the same data source. - ObjectFileELF::GetModuleSpecifications accesses some of these fields but the original parse uses too small data source. Re-parse the header if necessary using bigger data source. - ProcessElfCore::CreateInstance uses header with potentially sentinel values, but it does not access these fields, so a comment here is enough. Reviewers: labath Reviewed By: labath Subscribers: davidb, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D29095 Author: Eugene Birukov <eugenebi@hotmail.com> llvm-svn: 293714
* [CMake] [3/4] Update a batch of pluginsChris Bieneman2017-01-3110-10/+117
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293700
* Recognize Real-Time Signals on NetBSDKamil Rytarowski2017-01-281-3/+31
| | | | | | | | | | | | | | | | | | | | Summary: Real-Time Signals are available in NetBSD-current and will land NetBSD 8.0. Older stable versions of NetBSD will not be supported. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, clayborg, emaste Reviewed By: labath, clayborg, emaste Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29091 llvm-svn: 293391
* NPL: Compartmentalize arm64 single step workaround betterPavel Labath2017-01-254-133/+106
| | | | | | | | | | | The main motivation for me doing this is being able to build an arm android lldb-server against api level 9 headers, but it seems like a good cleanup nonetheless. The entirety of the cpu_set_t dance now resides in SingleStepCheck.cpp, which is only built on arm64. llvm-svn: 293046
* Replace chdir() usage with the llvm equivalent.Pavel Labath2017-01-251-6/+2
| | | | | | | This removes a hack in PosixApi.h, which tends to produce strange compile errors when it's included in the wrong order. llvm-svn: 293045
* Fix a bug where lldb does not respect the packet size.Hafiz Abid Qadeer2017-01-241-5/+25
| | | | | | | | | | | | | | Summary: LLDB was using packet size advertised by the target as the max memory size to write in one go. It is wrong because packets have other overhead apart from memory payload. Also memory transferred through 'm' and 'M' packets needs 2 bytes in packet to transfer 1 of memory. Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28808 llvm-svn: 292987
* FreeBSD ARM support for software single stepEd Maste2017-01-243-7/+231
| | | | | | | | | | | Implementation of software single step for FreeBSD on ARM. The code is largely based on the Linux implementation of the same functionality. Patch by Dmitry Mikulin! Differential Revision: https://reviews.llvm.org/D25756 llvm-svn: 292937
* android-mips: define PTRACE_GETREGSET in headers don't do itPavel Labath2017-01-241-0/+3
| | | | | | | PTRACE_GETREGSET is only defined on mips only since api level 21. Define it ourselves, so we can compile with older platform headers. llvm-svn: 292936
* Add format_provider for lldb::StateTypePavel Labath2017-01-241-5/+5
| | | | | | | | | | Reviewers: clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D29036 llvm-svn: 292920
* Prefer lzfse if it is an available compression method (this wasJason Molenda2017-01-241-3/+3
| | | | | | | defaulting to zlib previously). <rdar://problem/30159130> llvm-svn: 292884
* Replace getcwd with the llvm equivalentPavel Labath2017-01-231-4/+4
| | | | | | | | | | | | | | | | | | | | | Summary: getcwd() is not available (well.. um.. deprecated?) on windows, and the way PosixApi.h is providing it causes strange compile errors when it's included in the wrong order. The best way to avoid that is to just not use chdir. This replaces all uses of getcwd in generic code. There are still a couple of more uses, but these are in platform-specific code. chdir() is causing a similar problem, but for that there is no llvm equivalent for that (yet). Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28858 llvm-svn: 292795
* Prevent client from querying each thread's PC at each stop.Pavel Labath2017-01-203-33/+71
| | | | | | | | | | | | | | | | | | Summary: The server was no longer sending the thread PCs the way the client expected them. I changed the server to send them back as a threadstop info field, similar to the Apple version of the server. I also changed the client to look for them there, before querying the server. I added a test to ensure the server doesn't stop sending them. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D28880 Author: Jason Majors llvm-svn: 292611
* Fix more unused variable warnings when asserts are disabled.Hafiz Abid Qadeer2017-01-201-0/+1
| | | | llvm-svn: 292598
* Refactor logging in NativeProcessLinuxPavel Labath2017-01-191-637/+323
| | | | | | | | | | Use the LLDB_LOG macro instead of the more verbose if(log) ... syntax. I have also consolidated the log channels (everything now goes to the posix channel, instead of a mixture of posix and lldb), and cleaned up some of the more convoluted log statements. llvm-svn: 292489
* Avoid unused variable warning when assert is disabled.Hafiz Abid Qadeer2017-01-191-2/+2
| | | | llvm-svn: 292488
* [cmake] Make lldb build with the android ndk toolchain filePavel Labath2017-01-171-1/+1
| | | | | | | | | | | | | | | | | Summary: The NDK cmake toolchain file defines CMAKE_SYSTEM_NAME=Android, so switch the build to use that. I have also updated the in-tree toolchain file to do that (instead of defining __ANDROID_NDK__), so it can still be used to build. After migrating the last bits of non-toolchainy bits out of the in-tree toolchain, I intend to delete it. Reviewers: tberghammer, danalbert Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D28775 llvm-svn: 292212
* Fix -Wunused-function warning by preprocessor conditionalizing the function ↵David Blaikie2017-01-061-0/+2
| | | | | | the same way as the caller llvm-svn: 291199
OpenPOWER on IntegriCloud