Commit Graph

7307 Commits

Author SHA1 Message Date
Jim Ingham 39497e9f5b Make sure we resolve ~ in paths coming from the plist in a dSYM before adding them
to the path remappings.
Also don't add the paths to the path mapping when DebugSymbols tells up about files, since
we'll just do that again when we read in the dSYM.

<rdar://problem/21986208>

llvm-svn: 243181
2015-07-24 23:40:32 +00:00
Greg Clayton 88c05f54a0 Use double-checked locking to avoid locking the Module mutex if we don't need to. This avoid a deadlock we were seeing in Xcode.
<rdar://problem/21512067>

llvm-svn: 243180
2015-07-24 23:38:01 +00:00
Jason Molenda 67e5ba33e2 Log socket communications to LIBLLDB_LOG_COMMUNICATION instead of
the Host channel.

http://reviews.llvm.org/D11497

llvm-svn: 243175
2015-07-24 22:42:03 +00:00
Zachary Turner fbf8dad8eb Some fixes to get LLDB compiling with MSVC 2015.
llvm-svn: 243174
2015-07-24 22:32:22 +00:00
Siva Chandra d26eb907bc Add option eTypeOptionHideEmptyAggregates.
Summary:
For certain data structures, when the synthetic child provider returns
zero children, a summary like "Empty instance of <typename>" could be
more appropriate than something like "size=0 {}". This new option helps
hide the trailing "{}".

This is also exposed with a -h option for the command "type summary add".

Reviewers: granata.enrico

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11473

llvm-svn: 243166
2015-07-24 21:30:58 +00:00
Greg Clayton fceca9b539 Bind to the loopback when we are expecting a connection from 127.0.0.1 so we don't set off firewall protections.
<rdar://problem/17897318>

llvm-svn: 243118
2015-07-24 16:55:00 +00:00
Ewan Crawford 7340e1f8da Initialize variable to prevent garbage values (RenderScriptRuntime)
The kernels_found variable is not initialized, so if it is not assigned true on line 823, then it will be a garbage value in the branch condition on line 828. This patch initializes the variable to false. 

Patch by neilparikh.

Reviewers: domipheus
Differential Revision: http://reviews.llvm.org/D11323

llvm-svn: 243104
2015-07-24 10:01:11 +00:00
Pavel Labath f8b5874b63 Revert "Fix an issue where LLDB would run out of stack space ..."
This commit introduced an infinite recursion in
ValueObjectChild::CanUpdateWithInvalidExecutionContext (because FollowParentChain also considers
the current object), which broke nearly all the tests. Ignoring the current object removes the
recursion, but two tests still time out (TestDataFormatterLibcxxList.py and
TestValueObjectRecursion.py) for some reason. Reverting for now.

llvm-svn: 243102
2015-07-24 09:52:25 +00:00
Tamas Berghammer 5aa27e1acc Improve C++ function name handling and step-in avoid regerxp handling
If the function is a template then the return type is part of the
function name. This CL fixes the parsing of these function names in
the case when the return type contains ':'.

The name of free functions in C++ don't have context part. Fix the
logic geting the function name without arguments out from a full
function name to handle this case.

Change the handling of step-in-avoid-regexp to match the value against
the function name without it's arguments and return value. This is
required because the default regex ("^std::") would match any template
function returning an std object.

Fifferential revision: http://reviews.llvm.org/D11461

llvm-svn: 243099
2015-07-24 08:54:22 +00:00
Bhushan D. Attarde 1e271df041 Handle old style S packet correctly
SUMMARY:
    This patch fixes couple of issues:
    1. A thread tries to lock a mutex which is already locked.
    2. Updating a thread list before the stop packet is parsed so that it can get a valid thread id and allows to set the stop info correctly.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11449

llvm-svn: 243091
2015-07-24 04:06:20 +00:00
Enrico Granata 636cd262d6 Fix an issue where LLDB would run out of stack space trying to decide if a deeply nested child can be updated in the face of an invalid execution context
The issue is that a child can't really ask the root object, since this decision could actually hinge on whether a dynamic and/or synthetic value is present
To do this, make values vote lazily for whether they are willing to allow this, so that we can navigate up the chain without recursively invoking ourselves

Tentative fix for rdar://21949558

llvm-svn: 243077
2015-07-24 00:57:19 +00:00
Bruce Mitchener 8a67bf7298 Add UNUSED_IF_ASSERT_DISABLED and apply it.
Summary:
This replaces (void)x; usages where they x was subsequently
involved in an assertion with this macro to make the
intent more clear.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11451

llvm-svn: 243074
2015-07-24 00:23:29 +00:00
Greg Clayton f9d9db4975 Disable mutex error checking so it doesn't create problems with the multi-threaded test case. The error would cause an assertion that could cause lldb to crash when unlocking a mutex returned an error because it was in use.
llvm-svn: 243067
2015-07-23 23:32:08 +00:00
Jim Ingham 9b03fa0c69 Most thread plans don't handle eStopReasonInstrumentation stop reasons,
but that wasn't added to the list of reasons they don't explain.  That
would mean we keep stepping after hitting the AsanDie breakpoint rather
than stopping when the Asan event occurred.

<rdar://problem/21925479>

llvm-svn: 243035
2015-07-23 19:55:02 +00:00
Pavel Labath 162fb8e8ab Speed up NativeProcessLinux::GetLoadedModuleFileSpec
Summary:
GetLoadedModuleFileSpec was reading /proc/pid/maps character by character, which was very slow,
since we do that for every shared library, which android tends to have a lot. Switching to
ProcFileReader saves us about 0.4 seconds in attach time.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, lldb-commits

Differential Revision: http://reviews.llvm.org/D11460

llvm-svn: 243019
2015-07-23 14:47:33 +00:00
Pavel Labath 79203995fa [NativeProcessLinux] Fix a couple of warnings
llvm-svn: 243013
2015-07-23 13:07:37 +00:00
Pavel Labath 05569f679a Add jstopinfo support to llgs
Summary:
This adds support for jstopinfo field of stop-reply packets. This field enables us to avoid
querying full thread stop data on most stops  (see r242593 for more details).

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11415

llvm-svn: 242997
2015-07-23 09:09:29 +00:00
Greg Clayton 38e874e487 Fix TestReturnValue.py after 242903 changes that added vector register return value tests. These were failing on x86_64 and i386.
It also pointed out an error in our return values where the ABI only relies on xmm registers, not ymm registers for vector return types.

llvm-svn: 242972
2015-07-22 23:47:29 +00:00
Greg Clayton a3a11549ab Don't specify languages when setting breakpoints in C function names. We won't be able to tell from the symbol value alone what language the symbol is.
llvm-svn: 242969
2015-07-22 23:45:52 +00:00
Enrico Granata 1b3b2a3944 Set the live address on child const results in a way that is more maintainable for sustained merges with our internal branches
llvm-svn: 242944
2015-07-22 21:39:15 +00:00
Sean Callanan ceece95426 Don't complete an EnumDecl if it's already complete. We already do this check
for CXXRecordDecl.

<rdar://problem/21696221>

llvm-svn: 242929
2015-07-22 20:20:57 +00:00
Greg Clayton 06cdc198fe Fix warnings related to virtual functions not being marked as override.
llvm-svn: 242918
2015-07-22 18:16:05 +00:00
Bruce Mitchener a026de0585 Fix warnings.
Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11404

llvm-svn: 242913
2015-07-22 17:31:44 +00:00
Tamas Berghammer b6a04a141c Improve SysV ABI for ARM to handle return values with vector return type
This is required to print out the rerun value of funcions returning
types with the following attributes:
__attribute__((__vector_size__(8)));
__attribute__((ext_vector_type(2)));

Differential revision: http://reviews.llvm.org/D11416

llvm-svn: 242903
2015-07-22 14:53:37 +00:00
Kuba Brecka 5e73d2523f [asan] Display ASan history threads in reverse chronological order
For use-after-free bugs caught by ASan, we show an allocation and a deallocation stack trace. Let's display them in a "most recent event first" order, this patch does that.

Differential Revision: http://reviews.llvm.org/D11295

llvm-svn: 242902
2015-07-22 14:30:56 +00:00
Pavel Labath cb213b3831 Fix warnings found by -Wextra-semi
patch by Eugene Zelenko.

llvm-svn: 242875
2015-07-22 08:12:01 +00:00
Pavel Labath c2f33f6754 Make stream::operator<< take "const" void *
Summary:
This enables us to avoid casts to "void *" in some cases and avoids a couple of "casts off const
qualifiers" warnings.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11388

llvm-svn: 242874
2015-07-22 07:58:17 +00:00
Dawn Perchik 4112ab98ee Clean up wording in help for breakpoint --language option.
llvm-svn: 242866
2015-07-22 02:01:32 +00:00
Bruce Mitchener e171da5cb7 Fix typos.
Summary: Fix a bunch of typos.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11386

llvm-svn: 242856
2015-07-22 00:16:02 +00:00
Greg Clayton 5115bf8e73 Improve the performance of DWARFDebugInfo::GetCompileUnitContainingDIE() by using a binary search.
Also switched DWARFDebugInfo::GetCompileUnit() over to using the same kind of binary search instead of using bsearch().

llvm-svn: 242852
2015-07-21 22:53:51 +00:00
Dawn Perchik 23b1decbe7 Add support for specifying a language to use when parsing breakpoints.
Target and breakpoints options were added:
    breakpoint set --language lang --name func
    settings set target.language pascal
These specify the Language to use when interpreting the breakpoint's
expression (note: currently only implemented for breakpoints on
identifiers).  If the breakpoint language is not set, the target.language
setting is used.
This support is required by Pascal, for example, to set breakpoint at 'ns.foo'
for function 'foo' in namespace 'ns'.
Tests on the language were also added to Module::PrepareForFunctionNameLookup
for efficiency.

Reviewed by: clayborg
Subscribers: jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D11119

llvm-svn: 242844
2015-07-21 22:05:07 +00:00
Pavel Labath 19cbe96a45 [NativeProcessLinux] Integrate MainLoop
Summary:
This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with
the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of
thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been
reduced by about 40%). It also makes the code simpler, IMHO.

Reviewers: ovyalov, clayborg, tberghammer, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11150

This is a resubmission of r242305 after it was reverted due to bad interactions with the stdio
thread.

llvm-svn: 242783
2015-07-21 13:20:32 +00:00
Pavel Labath c7749c3acd [LLGS] Get rid of the stdio forwarding thread
Summary:
This commit removes the stdio forwarding thread in lldb-server in favor of a MainLoop callback.
As in some situations we need to forcibly flush the stream ( => Read() is called from multiple
places) and we still have multiple threads, I have had to additionally protect the communication
instance with a mutex.

Reviewers: ovyalov, tberghammer

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11296

llvm-svn: 242782
2015-07-21 13:20:25 +00:00
Pavel Labath 7c52f85322 Revert "Add Pipe::WriteWithTimeout method"
I have observed an increased flakyness in the buildbots. I suspect something was relying on the
fact that Pipe::Write had an implicit timeout of 1s, which this commit has removed. Reverting
while I investigate.

llvm-svn: 242767
2015-07-21 11:04:52 +00:00
Pavel Labath 9f0701f8ca Add Pipe::WriteWithTimeout method
Summary:
This commit adds a WriteWithTimeout method to time Pipe class, analogous to the existing
ReadWithTimeout(). It also changes the meaning of passing zero as a timeout value. Previously,
zero was used as an infinite timeout value. Now, the meaning of zero timeout to return the data
avaiable without sleeping (basically, a non-blocking operation). This makes the behaviour of Pipe
consistent with the Communication/Connection classes. For blocking operatios with infinite
timeout, I introduce a special constant for this purpose.

Reviewers: ovyalov, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11358

llvm-svn: 242764
2015-07-21 09:23:34 +00:00
Oleksiy Vyalov 5d9c50b538 Resolve DW_AT_comp_dir path if it contains a symlink
http://reviews.llvm.org/D11357

llvm-svn: 242757
2015-07-21 02:09:42 +00:00
Oleksiy Vyalov 8a578bf5d7 Fix FileSpec::IsSymlink implementation.
http://reviews.llvm.org/D11356

llvm-svn: 242753
2015-07-21 01:28:22 +00:00
Enrico Granata fbecf1ab1a The session dictionary attached to a Python interpeter holds variables the user creates in the script interpreter
This can include objects that have complex state and need to be torn down intelligently (e.g. our SB* objects)

This will fail if the Python interpreter does not hold a valid thread state. So, acquire one, delete the session dictionary, and then let go of it on destruction

This fixes rdar://20960843

llvm-svn: 242745
2015-07-21 00:38:25 +00:00
Greg Clayton 1f982c2d22 Correctly get the arguments and environment, even for processes that have a large amount or arguments and/or environment variables.
We previously passed in a 8192 byte buffer but this wasn't large enough. We now calculate the size we need and then add 128 to it and get the environment. If we pass exactly the number of bytes it says is needs, the sysctl() returns junk. Adding 1 seemed to do the trick, but to err on the side of caution, I added a few bytes more.

<rdar://problem/21883842>

llvm-svn: 242729
2015-07-20 22:52:13 +00:00
Sean Callanan abe140cc31 Eliminated a potential infinite recursion in structure layout when the origin
for a CXXRecordDecl gets pointed at that record.  This can happen when a type is
imported out of and then into the target's AST context without being laid out.

Also added a testcase that covers this scenario.

<rdar://problem/21844453>

llvm-svn: 242687
2015-07-20 16:55:19 +00:00
Pavel Labath 44e82db291 [NativeProcessLinux] Bugfix in the monitor thread
Make sure we dont treat EINTR as a fatal error. I was getting this when trying to profile the
debugger. I'm not sure why this wasn't surfacing before, it could be that the profiler is using
some signals internally.

llvm-svn: 242681
2015-07-20 16:14:46 +00:00
Tamas Berghammer c7959f7c69 Improve aarch64 instruction emulation
* Add emulation for STR/LDR immediate instructions
* Cleanup existing emulation code

llvm-svn: 242671
2015-07-20 13:52:50 +00:00
Greg Clayton 2e309076f2 More packet performance improvements.
Changed the "jthreads" key/value in the stop reply packets to be "jstopinfo". This JSON only contains threads with valid stop reasons and allows us not to have to ask about other threads via qThreadStopInfo when we are stepping. The "jstopinfo" only gets sent if there are more than one thread since the stop reply packet contains all the info needed for a single thread.

Added a Process::WillPublicStop() in case process subclasses want to do any extra gathering for public stops. For ProcessGDBRemote, we end up sending a jThreadsInfo packet to gather all expedited registers, expedited memory and MacOSX queue information. We only do this for public stops to minimize the packets we send when we have multiple private stops. Multiple private stops happen when a source level single step, step into or step out run the process multiple times while implementing the stepping, and none of these private stops make it out to the UI via notifications because they are private stops. 

llvm-svn: 242593
2015-07-17 23:42:28 +00:00
Enrico Granata 91443edff1 Remove a static helper function and use the StringPrinter API exclusively to format NSStrings
llvm-svn: 242583
2015-07-17 22:39:35 +00:00
Keno Fischer 3b3380ec44 [Makefiles] Re-add OSX specific code that got lost in lldbHost consolidation
llvm-svn: 242577
2015-07-17 21:47:35 +00:00
Enrico Granata 8a1cedddd8 Teach the "extend char types" (char16_t, char32_t and wchar_t) formatters that a *single character* whose value is 0 is actually a valid thing to print out
llvm-svn: 242572
2015-07-17 20:54:52 +00:00
Adrian McCarthy 633594c261 Implement FileSystem::GetPermissions for Windows. Differential Revision: http://reviews.llvm.org/D11303
llvm-svn: 242568
2015-07-17 20:23:03 +00:00
Chaoren Lin 2e3b97d4fb freeaddrinfo(NULL) segfaults on Android.
Reviewers: tberghammer

Subscribers: tberghammer, danalbert, lldb-commits

Differential Revision: http://reviews.llvm.org/D11285

llvm-svn: 242560
2015-07-17 19:12:33 +00:00
Enrico Granata 01dcaa36de Teach the NSString data formatter to handle embedded NULs in short ASCII strings
llvm-svn: 242559
2015-07-17 19:06:39 +00:00
Enrico Granata f219885fb5 Improve the NSString data formatter so that explicitly-lengthed Unicode strings print embedded NULs correctly
llvm-svn: 242555
2015-07-17 18:22:51 +00:00