summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix segfault resulting from empty print promptPavel Labath2017-05-052-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I have found a way to segfault lldb in 7 keystrokes! Steps to reproduce: 1) Launch lldb 2) Type `print` and hit enter. lldb will now prompt you to type a list of expressions, followed by an empty line. 3) Hit enter, indicating the end of your input. 4) Segfault! After some investigation, I've found the issue in Host/common/Editline.cpp. Editline::MoveCursor() relies on m_input_lines not being empty when the `to` argument is CursorPosition::BlockEnd. This scenario, as far as I can tell, occurs in one specific instance: In Editline::EndOrAddLineCommand() when the list of lines being processed contains exactly one string (""). Meeting this condition is fairly simple, I have posted steps to reproduce above. Reviewers: krytarowski, zturner, labath Reviewed By: labath Subscribers: scott.smith, lldb-commits Differential Revision: https://reviews.llvm.org/D32421 Patch by Alex Langford. llvm-svn: 302225
* Add TaskMap for iterating a function over a set of integersPavel Labath2017-05-054-167/+68
| | | | | | | | | | | | | | | | Summary: Many parallel tasks just want to iterate over all the possible numbers from 0 to N-1. Rather than enqueue N work items, instead just "map" the function across the requested integer space. Reviewers: clayborg, labath, tberghammer, zturner Reviewed By: clayborg, zturner Subscribers: zturner, lldb-commits Differential Revision: https://reviews.llvm.org/D32757 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 302223
* ABISysV_arm64: compute return value for large vectors correctlyPavel Labath2017-05-052-29/+55
| | | | | | | | | | | | | | | | | | | | | Summary: Arm64 Procedure Call Standard specifies than only vectors up to 16 bytes are stored in v0 (which makes sense, as that's the size of the register). 32-byte vector types are passed as regular structs via x8 pointer. Treat them as such. This fixes TestReturnValue for arm64-clang. I also split the test case into two so I can avoid the if(gcc) line, and annotate each test instead. (It seems the vector type tests fail with gcc only when targetting x86 arches). Reviewers: tberghammer, eugene Subscribers: aemerson, omjavaid, rengolin, srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D32813 llvm-svn: 302220
* [LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.Nitesh Jain2017-05-0411-5/+70
| | | | | | | | | | Reviewers: jingham, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D32168 llvm-svn: 302139
* MainLoop: Add unit testsPavel Labath2017-05-044-105/+229
| | | | | | | | | | | | | | | | | | | | Summary: This adds a couple of unit tests to the MainLoop class. To get the kqueue based version of the signal handling passing, I needed to modify the implementation a bit to make the queue object persistent. Otherwise, only the signals which are send during the Run call would get processed, which did not match the ppoll behaviour. I also took the opportunity to remove the ForEach template functions and replace them with something more reasonable. Reviewers: beanz, eugene Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D32753 llvm-svn: 302133
* Don't attempt to use mpx registers on unsupported platformsFrancis Ricci2017-05-032-0/+10
| | | | | | | | | | | | | | Summary: The existing cpp-level checks using PR_MPX_ENABLE_MANAGEMENT aren't sufficient, as this isn't defined for linux kernel versions below 3.19. Reviewers: valentinagiusti, zturner, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32719 llvm-svn: 302027
* Windows fix for TestConflictingDefinition makefilePavel Labath2017-05-031-1/+1
| | | | | | | | | | gnuwin32 rm does not like wildcards that match nothing even if we specify -f (probably because the wildcard expansion happens in-process there). We could use make $(wildcard) here, but it seems safer to explicitly list the files here, just like the normal Makefile.rules does. llvm-svn: 302013
* Check for lack of C++ context first when demanglingPavel Labath2017-05-031-18/+17
| | | | | | | | | | | | | | | Summary: It seems that if we have no context, then it can't possibly be a method. Check that first. Reviewers: clayborg Reviewed By: clayborg Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D32708 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 302008
* Fixed a bug where we did not properly use the complete versions of ↵Sean Callanan2017-05-0310-2/+136
| | | | | | | | | | Objective-C classes. Also added a test case, thanks to Greg Clayton. <rdar://problem/18913551> llvm-svn: 301993
* Android.rules: set "ar" path correctlyPavel Labath2017-05-021-0/+1
| | | | llvm-svn: 301918
* ObjectFileELF: Fix symbol lookup in bss sectionPavel Labath2017-05-024-1/+166
| | | | | | | | | | | | | | | | | | | | | | | | Summary: If we have symbol information in a separate file, we need to be very careful about presenting a unified section view of module to the rest of the debugger. ObjectFileELF had code to handle that, but it was being overly cautious -- the section->GetFileSize()!=0 meant that the unification would fail for sections which do not occupy any space in the object file (e.g., .bss). In my case, that manifested itself as not being able to display the values of .bss variables properly as the section associated with the variable did not have it's load address set (because it was not present in the unified section list). I test this by making sure the unified section list and the variables refer to the same section. Reviewers: eugene, zturner Subscribers: tberghammer, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D32434 llvm-svn: 301917
* Change UniqueCStringMap to use ConstString as the keyPavel Labath2017-05-0213-159/+135
| | | | | | | | | | | | | | | | Summary: UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness. ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons. Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate. Reviewers: #lldb, clayborg Reviewed By: clayborg Subscribers: labath, jasonmolenda, lldb-commits Differential Revision: https://reviews.llvm.org/D32316 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 301908
* Remove unused code related to CPlusPlusLanguage::FindEquivalentNamesPavel Labath2017-05-022-150/+0
| | | | | | | | | | | | | | | Summary: It is simply unused, and the header for it is private, so there should be no external dependencies. Reviewers: #lldb, zturner Reviewed By: zturner Subscribers: zturner, tberghammer, jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D32503 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 301903
* Public headers need to be public.Tim Hammerquist2017-04-281-2/+2
| | | | llvm-svn: 301686
* Add remaining SBTrace headers to LLDB frameworkTim Hammerquist2017-04-281-0/+4
| | | | llvm-svn: 301664
* Remove lock from ConstString::GetLengthPavel Labath2017-04-281-18/+11
| | | | | | | | | | | | | | | Summary: ConstStrings are immutable, so there is no need to grab even a reader lock in order to read the length field. Reviewers: #lldb, labath Reviewed By: labath Subscribers: zturner, labath, lldb-commits Differential Revision: https://reviews.llvm.org/D32306 Patch by Scott Smith <scott.smith@purestorage.com> llvm-svn: 301642
* Resurrect pselect MainLoop implementationPavel Labath2017-04-282-94/+209
| | | | | | | | | | | | | | | | | | | | Summary: It turns out that even though ppoll is available on all the android devices we support, it does not seem to be working properly on all of them -- MainLoop just does a busy loop with ppoll returning EINTR and not making any progress. This brings back the pselect implementation and makes it available on android. I could not do any cmake checks for this as the ppoll symbol is actually avaiable -- it just does not work. Reviewers: beanz, eugene Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D32600 llvm-svn: 301636
* Provide a mechanism to do some pre-loading of symbols up front.Jim Ingham2017-04-2811-4/+78
| | | | | | | | | | | Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
* Add a newline to suppress compiler warnings.Jim Ingham2017-04-281-1/+1
| | | | llvm-svn: 301608
* Resurrect the standalone build of LLDBKamil Rytarowski2017-04-282-2/+2
| | | | | | | | Switch includes "llvm/Config/config.h" to "llvm/Config/llvm-config.h". Tested on NetBSD 7.99.70 amd64 llvm-svn: 301603
* integrate SBTrace changes into Xcode projectTim Hammerquist2017-04-271-0/+12
| | | | llvm-svn: 301600
* Fixing Windows botChris Bieneman2017-04-271-1/+1
| | | | | | | URL: http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/8700 llvm-svn: 301581
* NFC. Add comment about debugserver usageChris Bieneman2017-04-271-0/+6
| | | | | | | | This just adds a comment to SocketAddress about it being used by debugserver and the implications of that. If we need to make changes to this class that make it unsuitable for debugserver we can re-implement the minimal abstractions we need from this file in debugserver. I would prefer not to do that because code duplication is bad. Nuff said. llvm-svn: 301580
* Fix GreenDragon botsChris Bieneman2017-04-271-2/+0
| | | | | | We don't actually need to include Compiler.h here because it is only used on Windows and Windows/PosixAPI.h includes it. llvm-svn: 301579
* Update GDB remote command regex for IPv6Chris Bieneman2017-04-271-2/+2
| | | | | | | | This updates the regular expression used to match host/port pairs for the gdb-remote command to also match IPv6 addresses. The IPv6 address matcher is very generic and does not really check for structural validity of the address. It turns out that IPv6 addresses are very complicated. llvm-svn: 301559
* [CMake] Abstract Config.h generation for XcodeChris Bieneman2017-04-274-27/+60
| | | | | | | | This patch abstracts the generation of Config.h and creates a dummy project entry point to allow generation of LLDB's Config header without performing a full CMake configuration. This will enable the Xcode project to generate LLDB's Config header. llvm-svn: 301553
* [LLDB][MIPS] Forgot to add check in commit rl301530Nitesh Jain2017-04-271-2/+4
| | | | | | | Reviewers: ki.stfu, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 301537
* TCPSocket: add back support for "*" addressPavel Labath2017-04-271-0/+2
| | | | | | | | | | | | | before r301492, we could specify "*:1234" as an address to lldb-server and it would interpret that as "any". I am not sure that's a good idea, but we have usages of that in the test suite, and without this the remote test suite fails. I'm adding that back, as it does not seem it was an intended side-effect of that change, but I am open to removing it in the future, after discussion and test suite fixup. llvm-svn: 301534
* [LLDB][MIPS] Fix TestMiExec.py failure.Nitesh Jain2017-04-271-2/+8
| | | | | | | | | | Reviewers: ki.stfu, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D32340 llvm-svn: 301530
* Fix build for clang r301507Pavel Labath2017-04-271-2/+2
| | | | | | LangStandard::lang_opencl -> LangStandard::lang_opencl10 llvm-svn: 301524
* One more try at the whole compiling thing...Chris Bieneman2017-04-271-1/+1
| | | | | | Need to actually use the right type in both parts of the cast. llvm-svn: 301506
* One more attempt to fix the broken bots.Chris Bieneman2017-04-271-0/+2
| | | | llvm-svn: 301504
* Fix Windows bots broken by r301492Chris Bieneman2017-04-271-1/+3
| | | | | | http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/8644/ llvm-svn: 301502
* Fix libcxx formatters for changes in r300140.Lang Hames2017-04-263-16/+87
| | | | | | | | | | | | | | | | | | Summary: LLVM r300140 changed the layout and field names of __compressed_pair, which broke LLDB's std::vector, std::map and std::unsorted_map formatters. This patch attempts to fix these formatters by having them interogate the __compressed_pair values to determine whether they're pre- or post-r300140 variants, then access them accordingly. Reviewers: jingham, EricWF Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D32554 llvm-svn: 301493
* Re-landing IPv6 support for LLDB HostChris Bieneman2017-04-2629-487/+680
| | | | | | | | | | | | | | | | | | | | | | This support was landed in r300579, and reverted in r300669 due to failures on the bots. The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that. Summary from the original change: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. https://reviews.llvm.org/D31823 llvm-svn: 301492
* Update lldb to match clang r301442.Richard Smith2017-04-261-22/+15
| | | | | | | | This code really doesn't make any sense: there is only ever one InputKind here. Plus, this is an incomplete and out-of-date copy-paste of some Clang code. This really ought to be revisited, but this change should get the bots green again. llvm-svn: 301483
* Fixed a crash when dealing with an empty method name in the ObjC runtime.Sean Callanan2017-04-261-1/+6
| | | | | | | | I've filed a bug covering better unit testing of our runtime metadata reader, which will allow this to be testable.. <rdar://problem/31793264> llvm-svn: 301461
* Use llvm::ArrayRef rather than std::vector/std::initializer lists for someLang Hames2017-04-263-52/+11
| | | | | | | | | | | ValueObject methods. Using ArrayRef allows us to remove some overloads, work with more array-like types, and avoid some std::vector temporaries. https://reviews.llvm.org/D32518 llvm-svn: 301441
* Initial implementation of SB APIs for Tracing support.Ravitheja Addepally2017-04-2622-69/+785
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces new SB APIs for tracing support inside LLDB. The idea is to gather trace data from LLDB and provide it through this APIs to external tools integrating with LLDB. These tools will be responsible for interpreting and presenting the trace data to their users. The patch implements the following new SB APIs -> -> StartTrace - starts tracing with given parameters -> StopTrace - stops tracing. -> GetTraceData - read the trace data . -> GetMetaData - read the meta data assosciated with the trace. -> GetTraceConfig - read the trace configuration Tracing is associated with a user_id that is returned by the StartTrace API and this id needs to be used for accessing the trace data and also Stopping the trace. The user_id itself may map to tracing the complete process or just an individual thread. The APIs require an additional thread parameter when the user of these APIs wishes to perform thread specific manipulations on the tracing instances. The patch also includes the corresponding python wrappers for the C++ based APIs. Reviewers: k8stone, lldb-commits, clayborg Reviewed By: clayborg Subscribers: jingham, mgorny Differential Revision: https://reviews.llvm.org/D29581 llvm-svn: 301389
* Remove the home-grown android toolchain file and all references to itPavel Labath2017-04-252-186/+24
| | | | | | | | | | | | | | | Summary: The toolchain file has been deprecated in favor of the "official" toolchain file present in the Android NDK. Also update the web build instructions to reflect this. Reviewers: eugene Subscribers: srhines, mgorny, dgross, tberghammer, lldb-commits Differential Revision: https://reviews.llvm.org/D32441 llvm-svn: 301306
* [LLDB][MIPS] Fix typo in TestStepOverWatchpoint.py.Nitesh Jain2017-04-251-1/+1
| | | | | Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 301295
* Name the C++ source files for two tests correctly.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301280
* Fixed two bad Makefiles that might be breaking Linux.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301277
* [Expression parser] Return both types and variablesSean Callanan2017-04-248-258/+347
| | | | | | | | | | | | | | | | | | | | | Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name. Depending on the precise context, currently the expression parser can fail to resolve one or the other. This is because ClangExpressionDeclMap has logic to limit the amount of information it searches, and that logic sometimes cuts down the search prematurely. This patch removes some of those early exits. In that sense, this patch trades performance (early exit is faster) for correctness. I've also included two new test cases showing examples of this behavior – as well as modifying an existing test case that gets it wrong. llvm-svn: 301273
* [DWARF] Fix lookup in the abstract origins of inlined blocks/functionsSean Callanan2017-04-244-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLDB uses clang::DeclContexts for lookups, and variables get put into the DeclContext for their abstract origin. (The abstract origin is a DWARF pointer that indicates the unique definition of inlined code.) When the expression parser is looking for variables, it locates the DeclContext for the current context. This needs to be done carefully, though, e.g.: __attribute__ ((always_inline)) void f(int a) { { int b = a * 2; } } void g() { f(3); } Here, if we're stopped in the inlined copy of f, we have to find the DeclContext corresponding to the definition of f – its abstract origin. Clang doesn't allow multiple functions with the same name and arguments to exist. It also means that any variables we see must be placed in the appropriate DeclContext. [Bug 1]: When stopped in an inline block, the function GetDeclContextDIEContainingDIE for that block doesn't properly construct a DeclContext for the abstract origin for inlined subroutines. That means we get duplicated function DeclContexts, but function arguments only get put in the abstract origin's DeclContext, and as a result when we try to look for them in nested contexts they aren't found. [Bug 2]: When stopped in an inline block, the DWARF (for space reasons) doesn't explicitly point to the abstract origin for that block. This means that the function GetClangDeclContextForDIE returns a different DeclContext for each place the block is inlined. However, any variables defined in the block have abstract origins, so they will only get placed in the DeclContext for their abstract origin. In this fix, I've introduced a test covering both of these issues, and fixed them. Bug 1 could be resolved simply by making sure we look up the abstract origin for inlined functions when looking up their DeclContexts on behalf of nested blocks. For Bug 2, I've implemented an algorithm that makes the DeclContext for a block be the containing DeclContext for the closest entity we would find during lookup that has an abstract origin pointer. That means that in the following situation: { // block 1 int a; { // block 2 int b; } } if we looked up the DeclContext for block 2, we'd find the block containing the abstract origin of b, and lookup would proceed correctly because we'd see b and a. However, in the situation { // block 1 int a; { // block 2 } } since there isn't anything to look up in block 2, we can't determine its abstract origin (and there is no such pointer in the DWARF for blocks). However, we can walk up the parent chain and find a, and its abstract origin lives in the abstract origin of block 1. So we simply say that the DeclContext for block 2 is the same as the DeclContext for block 1, which contains a. Lookups will return the same results. Thanks to Jim Ingham for review and suggestions. Differential revision: https://reviews.llvm.org/D32375 llvm-svn: 301263
* Update two android XFAILSPavel Labath2017-04-242-2/+2
| | | | | | | - XFAIL on TestNoreturnUnwind on all architectures - TestStaticVariables fails with clang-3.8 as well llvm-svn: 301186
* Fix the new SocketAddressTest on WindowsPavel Labath2017-04-241-3/+20
| | | | | | we need to call WSAStartup before we can use getaddrinfo. llvm-svn: 301179
* [LLDB][MIPS] Move it into HandleLLVMOptions.cmake.Nitesh Jain2017-04-241-6/+0
| | | | | | | The revison https://reviews.llvm.org/D32125 will fixed the off_t for GNU specific 32 bit platform. This fixed the difference in definition of off_t in LLDB and LLVM Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste, zturner llvm-svn: 301172
* Add more arguments to SocketAddress::GetAddressInfoPavel Labath2017-04-243-27/+26
| | | | | | | | | | | | | | | | | | | Summary: the reason for this is two-fold: - getaddrinfo without the extra arguments will return the same (network-level) address multiple times, once for each supported transport protocol, which is not what is usually intended (it certainly wasn't in D31823) - it enables us to rewrite the getaddrinfo member function in terms of the static GetAddressInfo function. Reviewers: beanz, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32357 llvm-svn: 301168
* Simplify FreeBSD Host.cpp with early returnsEd Maste2017-04-231-78/+86
| | | | | | Based on NetBSD's Host.cpp. Also tidy up comments to match NetBSD. llvm-svn: 301100
OpenPOWER on IntegriCloud