Commit Graph

12286 Commits

Author SHA1 Message Date
Jason Molenda 3874ee6869 Bump the version # in the xcode proj file from major number 340 to 350.
The SB API for major version 340 won't be changing any more.

llvm-svn: 243943
2015-08-04 03:14:49 +00:00
Bruce Mitchener 3dd3a77e81 Fix cmake build on non-Windows platforms.
r243914 introduced a change which mistakenly tried to build the
Windows minidump code on all platforms rather than only on Windows.

llvm-svn: 243941
2015-08-04 02:41:49 +00:00
Chaoren Lin 845f40ada6 XFAIL TestInferiorAssert for Android API <= 16.
llvm-svn: 243922
2015-08-03 23:59:41 +00:00
Adrian McCarthy c96516fddf Create a Windows mini-dump target Differential Revision: http://reviews.llvm.org/D11611
llvm-svn: 243914
2015-08-03 23:01:51 +00:00
Enrico Granata 760af88d86 Jim suggested to use eArgTypeAddressOrExpression for the addresses that 'memory find' takes
llvm-svn: 243902
2015-08-03 20:47:19 +00:00
Enrico Granata 0b3b987840 Fix the memory find command such that it can actually take an expression
llvm-svn: 243893
2015-08-03 18:51:39 +00:00
Jason Molenda a21fdb0dd6 GDBRemoteCommunication::DecompressPacket assumed that the buffer it was
working with (the Communication m_bytes ivar) contained a single packet.
Instead, it may contain multitudes.  Find the boundaries of the first packet
in the buffer and replace that with the decompressed version leaving the
rest of the buffer unmodified.
<rdar://problem/21841377> 

llvm-svn: 243846
2015-08-02 01:36:09 +00:00
Dawn Perchik c18daf29ae [lldb-mi] Fix evaluation for children of created variable object.
Move code in CMICmdCmdVarListChildren::Execute() up so that the child
object will always be added when the MI command -var-list-children is
entered (instead of only when the print-value was all or simple).  This
patch fixes evaluation of expressions like varobj.member for a created
varobj with children.

Reviewed by: abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11659

llvm-svn: 243782
2015-07-31 21:00:00 +00:00
Ed Maste 8b559ecf52 Improve man page markup
Patch by Baptiste Daroussin

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

llvm-svn: 243749
2015-07-31 14:26:15 +00:00
Ed Maste 343ad62374 Report original thread ID for FreeBSD core files
On FreeBSD the tid is (somewhat unintuitively) found in the pr_pid
field of the NT_PRSTATUS note. Collect it when parsing the note and
store it in the thread data.

For Linux I've left the original behaviour of using sequential TIDs
(0, 1, 2...) as I don't yet have code to obtain it.

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

llvm-svn: 243748
2015-07-31 14:24:32 +00:00
Hafiz Abid Qadeer 311d08f8de Escape new line and tabs in the result of variable evaluation.
Expression evaluation error messages may have embedded new lines
and tabs. These should be escaped in the result string.

Patch by paulmaybee. Reviewed in http://reviews.llvm.org/D11570.

llvm-svn: 243741
2015-07-31 09:24:39 +00:00
Pavel Labath 7fb4e2d4ac Fix Clang-tidy misc-use-override warnings in some files in include/lldb/Core, unify closing inclusion guards
Patch by Eugene Zelenko

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

llvm-svn: 243738
2015-07-31 08:17:10 +00:00
Jason Molenda c709958572 Move the computation of whether a DWARF compile unit
is optimized into DWARFCompileUnit, where it should have
been.  Next I'll need to call this from another section 
of code for DWARF-in-.o-file behavior correctness.

llvm-svn: 243736
2015-07-31 05:47:00 +00:00
Jason Molenda 7138765d45 Add another log to the Host channel for logging
the actions taken when trying to locate binaries.

llvm-svn: 243732
2015-07-31 04:21:25 +00:00
Chaoren Lin d7bdc27b12 Allow ValueObject::Dereference to dereference references.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 243716
2015-07-31 00:35:40 +00:00
Dawn Perchik 3cb6dd6e94 Fix build of lldb on Mavericks after svn rev.243511.
This patch adds a test for ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED
around the code which requires 10.10 support to link. Without this, lldb
gets unresolved references to _csr_check and _rootless_allows_task_for_pid.

Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11668

llvm-svn: 243715
2015-07-31 00:26:46 +00:00
Dawn Perchik e0c96acebc Fix help message for target.language setting.
llvm-svn: 243697
2015-07-30 22:10:08 +00:00
Zachary Turner 2c1f46dcc6 Convert the ScriptInterpreter system to a plugin-based one.
Previously embedded interpreters were handled as ad-hoc source
files compiled into source/Interpreter.  This made it hard to
disable a specific interpreter, or to add support for other
interpreters and allow the developer to choose which interpreter(s)
were enabled for a particular build.

This patch converts script interpreters over to a plugin-based system.
Script interpreters now live in source/Plugins/ScriptInterpreter, and
the canonical LLDB interpreter, ScriptInterpreterPython, is moved there
as well.

Any new code interfacing with the Python C API must live in this location
from here on out.  Additionally, generic code should never need to
reference or make assumptions about the presence of a specific interpreter
going forward.

Differential Revision: http://reviews.llvm.org/D11431
Reviewed By: Greg Clayton

llvm-svn: 243681
2015-07-30 20:28:07 +00:00
Chaoren Lin 46951b5968 Use only unnamed pipes to launch lldb-server gdbserver.
Summary:
If we used unnamed pipes instead of named pipes, we can avoid having the
file system littered with debugserver-named-pipes if lldb-server happens to
crash for whatever reason. Also, on some buggy systems, it's possible to be
able to create but not to delete a fifo. Ideally, support for unnamed pipes
should be added to debugserver as well, so we can avoid the `#ifdef` here.

Reviewers: clayborg, vharron, chying

Subscribers: lldb-commits

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

llvm-svn: 243667
2015-07-30 17:48:44 +00:00
Tamas Berghammer d00438e8f0 Fix issues with separate symbolfile handling
Differential revision: http://reviews.llvm.org/D11595

llvm-svn: 243637
2015-07-30 12:38:18 +00:00
Tamas Berghammer 3e64245698 Mark TestMiBreak as falkey on Linux
llvm-svn: 243628
2015-07-30 09:09:22 +00:00
Mohit K. Bhakkad c356d8be53 [LLDB][MIPS] Added expected failure for "test disassembler settings"
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, emaste, lldb-commits.
Differential Revision: http://reviews.llvm.org/D11562

llvm-svn: 243622
2015-07-30 05:45:56 +00:00
Ilia K 6b8ade52b9 Clean up test/tools/lldb-mi/variable/main.cpp after r243619
llvm-svn: 243621
2015-07-30 05:39:31 +00:00
Mohit K. Bhakkad 3681c5b850 [LLDB][MIPS] To handle SI_KERNEL generated for invalid 64 bit address
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, emaste, lldb-commits.
Differential Revision: http://reviews.llvm.org/D11176

llvm-svn: 243620
2015-07-30 05:38:11 +00:00
Ilia K 6940581e45 Fix bug in expression display when determining if a pointer should be treated as a string
Summary:
Currently if the "first child" of the pointer is a char type then the pointer is displayed as a string. This test succeeds incorrectly when the pointer is to a structured type with a char type as its first field. Fix this by switching the test to retrieve the pointee type and checking that it is a char type.


Reviewers: abidh, ChuckR, ki.stfu

Subscribers: greggm, lldb-commits

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

llvm-svn: 243619
2015-07-30 05:32:41 +00:00
Jaydeep Patil 6fc590dadc [LLDB][MIPS] Create Unix Signals based on target architecture
SUMMARY:
    The patch creates Unix Signals based on target architecture. For MIPS it creates MipsLinuxSignals.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11455

llvm-svn: 243618
2015-07-30 05:06:51 +00:00
Oleksiy Vyalov abb5a35d05 Make DWARF at_comp_dir symbolic links configurable via plugin.symbol-file.dwarf.comp-dir-symlink-paths setting.
http://reviews.llvm.org/D11586

llvm-svn: 243580
2015-07-29 22:18:16 +00:00
Greg Clayton 0d5b0a8a78 Centralize where we update the source file contents in SourceManager::GetFile() in case APIs are called that don't update the source.
The following functions were the only functions that updates the source file:

SourceManager::File::DisplaySourceLines()
SourceManager::File::FindLinesMatchingRegex()    

But there we API calls that were using the SourceManager::File and asking it questions, like "is line 12 valid" and that might respond incorrectly if the source file had been updated.

<rdar://problem/21269402>

llvm-svn: 243551
2015-07-29 18:37:25 +00:00
Jim Ingham 9d1ccdaf7e Add a function to make a mutex-protected copy of a breakpoint site's
owners list, so the StopInfo machinery can get the list of owners without
some other thread being able to mess up the list by deleting/disabline one of its
locations in the process of doing so.

<rdar://problem/18685197>

llvm-svn: 243541
2015-07-29 17:51:36 +00:00
Tamas Berghammer e3a182c052 Fix read/write context in EmulateInstructionARM strd/ldrd
llvm-svn: 243521
2015-07-29 15:15:42 +00:00
Tamas Berghammer e98e3f6325 Remove non-utf-8 characters from EmulateInstructionARM
llvm-svn: 243520
2015-07-29 15:14:37 +00:00
Pavel Labath 6e4f19d440 [LLGS] Spawned process handling cleanup
Summary:
This commit moves the m_spawned_pids member from the common LLGS/Platform class to the plaform
specific part. This enables us to remove LLGS code, which was attempting to manage the
m_spawned_pids contents, but at the same time making sure, there is only one debugged process. If
we ever want to do multi-process debugging, we will probably want to replace this with a set of
NativeProcessProtocolSP anyway. The only functional change is that support for
qKillSpawnedProcess packet is removed from LLGS, but this was not used there anyway (we have the
k packet for that).

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 243513
2015-07-29 12:33:31 +00:00
Jason Molenda 752e1e833b When debugserver fails to attach to a process on a Darwin
system, make a couple of additional checks to see if the
attach was denied via the System Integrity Protection that
is new in Mac OS X 10.11.  If so, return a special E87
error code to indicate this to lldb.

Up in lldb, if we receive the E87 error code, be specific
about why the attach failed.

Also detect the more common case of general attach failure
and print a better error message than "lost connection".

I believe this code will all build on Mac OS X 10.10 systems.
It may not compile or run on earlier versions of the OS.
None of this should build on other non-darwin systems.

llvm-svn: 243511
2015-07-29 01:42:16 +00:00
Dawn Perchik 6a40cd71f6 [lldb-mi] Fix tests added in r243484 for breakpoints using file:func syntax.
llvm-svn: 243510
2015-07-29 01:01:14 +00:00
Jason Molenda 6ab659a922 First part of an attempt to indicate to the user when they are
debugging optimized code.  Adds new methods on Function/SBFunction
to query whether a given function is optimized.  Adds a new
function.is-optimized format entity and changes the default 
frame-format to append "[opt]" if the function was built with
optimization.

The only indication that a binary was built with optimization
that we have right now is the presence of the DW_AT_APPLE_optimized
attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit.
The absence of this flag may mean that the compile_unit was not
compiled with optimization, or it may mean that the producer 
does not generate this attribute.

Currently this only works for dSYM debugging.  When we create
the CompileUnit with dwarf-in-.o-file debugging we don't have
the attribute value yet so it's not set.  I need to find the
flag value when we do start to read the .o file DWARF and 
set the CompileUnit's status at that point - but haven't 
done it yet.

I'm also going to add a mechanism for issuing warnings to users
such that they're only issued once in a debug session and 
there is away for users to suppress these warnings altogether
via .lldbinit file settings.  But I want to get this changeset
committed now that it's at a useful state.

<rdar://problem/19281172> 

llvm-svn: 243508
2015-07-29 00:42:47 +00:00
Jim Ingham ff244c1d97 Lock the owners mutex in the BreakpointSite before updating the hit
counts.  If you delete a breakpoint belonging to a site just as you are
processing a hit on that site, you could cause the BreakpointSite loop to
access a now deleted location.

<rdar://problem/19310323>

llvm-svn: 243507
2015-07-29 00:40:36 +00:00
Dawn Perchik a16faba6b0 [lldb-mi] XFAIL new test added in r243484.
llvm-svn: 243504
2015-07-29 00:22:53 +00:00
Dawn Perchik fc6eb071ab Fix comment in TestExprOptions to match change of language from ObjC to ObjC++.
llvm-svn: 243488
2015-07-28 22:19:42 +00:00
Dawn Perchik c69780d797 [lldb-mi] Fix setting of breakpoints using file:func syntax.
Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11499

llvm-svn: 243484
2015-07-28 21:40:57 +00:00
Enrico Granata 2646469671 Cleanup a few stale comments in FormattersContainer.h
llvm-svn: 243483
2015-07-28 21:28:33 +00:00
Enrico Granata 45619555d9 Make ClangASTType::RemoveFastQualifiers() actually do something useful
llvm-svn: 243482
2015-07-28 21:24:39 +00:00
Enrico Granata 8eb9c3068c Fix a bug where the std::list synthetic child provider would not clean its cache correctly on update, causing stale children to be returned in some circumstances
Fixes rdar://20560680

llvm-svn: 243472
2015-07-28 20:19:45 +00:00
Ed Maste a43ce0dc98 FreeBSDThread::GetRegisterContext is only for FreeBSD targets
The removal of in-process Linux debug support left a switch statement
with llvm::Triple::FreeBSD as the only case. Simplify by replacing it
with a now-equivalent assertion.

llvm-svn: 243468
2015-07-28 19:47:00 +00:00
Ed Maste 63c9fa01eb Remove eNewThreadMessage from FreeBSD process monitor
FreeBSD thread information is updated after stop - we do not use a
message for thread creation.

llvm-svn: 243448
2015-07-28 16:57:36 +00:00
Ed Maste 5bfed4a77f Update xcode for r243427
llvm-svn: 243432
2015-07-28 16:11:12 +00:00
Ed Maste 7d47b7a294 Remove two additional files missed in r243427
llvm-svn: 243428
2015-07-28 15:48:38 +00:00
Ed Maste fe5a6428b8 Remove POSIX thread/process abstraction
As of r240543 ProcessPOSIX and POSIXThread are used only on FreeBSD, so
just roll them into ProcessFreeBSD and FreeBSDThread.

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

llvm-svn: 243427
2015-07-28 15:45:57 +00:00
Pavel Labath 4b7dc299c2 Fix typo in gdbremote.py
llvm-svn: 243421
2015-07-28 15:13:23 +00:00
Pavel Labath 3a29f8b9ec Fix warnings detected by -Wpessimizing-move
patch by Eugene Zelenko

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

llvm-svn: 243399
2015-07-28 09:18:32 +00:00
Pavel Labath 424b201df7 [LLGS] Avoid bogus error message on process termination
Summary:
Handle_k was printing an error when killing a process because KillSpawnedProcess was expecting to
be asynchronously notified of the process death, which no longer works, since we don't wait for
the process on a separate thread. However, the whole usage of KillSpawnedProcess is dubious here,
since it tries to be nice and terminate the process first with SIGTERM, which will not have the
intended effect on a ptraced process. I replace this code with a call to
NativeProcessProtocol::Kill, which does not suffer from these problems.

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 243397
2015-07-28 09:06:56 +00:00
Ilia K b56c50f0ec Support escapes and quotes in string and character values.
Summary:
Escape characters in strings and strings containing quotes were not appearing correctly in expression values.

Patch from paulmay@microsoft.com

Reviewers: abidh, ChuckR, paulmaybee

Subscribers: greggm, lldb-commits

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

llvm-svn: 243383
2015-07-28 05:43:47 +00:00
Enrico Granata d29116331d There is no reason why this formatter should not cascade. Make it cascade
llvm-svn: 243369
2015-07-28 02:13:03 +00:00
Enrico Granata 2e9f29932d Second attempt at the fix for the recursion in ValueObjectChild::CanUpdateWithInvalidExecutionContext()
This one should prevent the previous issues, and be the one true fix for rdar://21949558

llvm-svn: 243367
2015-07-28 01:45:23 +00:00
Greg Clayton a381e10518 Make sure we detect symbols in the new __DATA_DIRTY and __DATA_CONST segments and classify them correctly.
<rdar://problem/20942073>

llvm-svn: 243344
2015-07-27 23:21:05 +00:00
Greg Clayton a90d0992b7 Fix test suite. For now we can't disable C++ for expressions since the return value is returned as a reference and this test fails on MacOSX.
llvm-svn: 243342
2015-07-27 23:02:14 +00:00
Chaoren Lin 4630de80c5 Deprecate `SBValue::TypeIsPointerType`.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 243333
2015-07-27 21:51:56 +00:00
Ying Chen f1dfb4d1eb Fix Windows buildbot failure after rev 243301
Summary:
- Visual Studio doesn't support "list initialization inside member initializer list"
- Call inner struct constructor explicitly

Reviewers:
enrico
Subscribers:
lldb-commits

llvm-svn: 243332
2015-07-27 21:47:14 +00:00
Enrico Granata 99e5e22091 If a path contains a '/' before a ':', then the ':' is not a hostname separator, but just a part of the path (e.g. /tmp/fi:lename vs. pro:/tmp/fi:lename)
llvm-svn: 243330
2015-07-27 21:27:02 +00:00
Chaoren Lin 5ce142b429 Only test ObjC expression options on Darwin.
Reviewers: dawn, emaste, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 243329
2015-07-27 21:15:01 +00:00
Ed Maste 6cfb894892 XFAIL test_with_dwarf_formatters_api on FreeBSD
llvm.org/pr24282

llvm-svn: 243309
2015-07-27 19:20:42 +00:00
Ed Maste 7c98da6451 XFAIL TestExprOptions on FreeBSD.
r243230 XFAILed it for Linux; it also fails on FreeBSD.

llvm-svn: 243307
2015-07-27 19:10:16 +00:00
Enrico Granata c1b7c09ac4 Add a more tweakable way for ValueObjectPrinter to control pointer expansion. NFC.
llvm-svn: 243301
2015-07-27 18:34:14 +00:00
Dawn Perchik c9a0d3be69 [lldb-mi] Fix breakpoints on functions when C++ namespaces are used.
The command "-break-insert ns::foo" for function 'foo' in namespace 'ns'
was being parsed as file:function.  This patch fixes these cases by adding
checks for '::'. (Note: '::func' is not parsed correctly by lldb due to
llvm.org/pr24271).

Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11396

llvm-svn: 243281
2015-07-27 17:03:34 +00:00
Oleksiy Vyalov e837e6c7f7 Fix jSignalsInfo packet handling.
llvm-svn: 243257
2015-07-27 01:32:58 +00:00
Chaoren Lin 424848cabe XFAIL TestExprOptions on Linux.
llvm-svn: 243230
2015-07-25 22:06:48 +00:00
Benjamin Kramer 882b964aaf Add missing namespace specifiers.
llvm-svn: 243220
2015-07-25 15:44:23 +00:00
Benjamin Kramer 4665c29b81 Upgrade for Clang API change.
llvm-svn: 243219
2015-07-25 15:33:17 +00:00
Jason Molenda 08a3258bd8 Add some initial logging for when lldb is searching for binaries,
dSYMs, or reading binaries out of memory to the 'Host' log channel.
There's more to be done here, both for Mac and for other platforms,
but the initial set of new loggings are useful enough to check in
at this point.

llvm-svn: 243200
2015-07-25 02:39:42 +00:00
Jim Ingham 9435b3c298 Shorten the lldb timeout, we were seeing occasional failure because
lldb didn't wake up before the target function got a chance to complete.

<rdar://problem/21990308>

llvm-svn: 243193
2015-07-25 00:52:38 +00:00
Dawn Perchik 15663c530e Specify a language to use when parsing expressions.
This patch adds the option -l/--language to the expression command, for
use when setting the language options or choosing an alternate FE. If
not specified, the target.language setting is used.

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

llvm-svn: 243187
2015-07-25 00:19:39 +00:00
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
Bruce Mitchener b1e77a3642 Fix Mac OS X build, debugserver version handling.
Summary:
No longer rely on cmake to set DEBUGSERVER_VERSION_STR,
but now generate the _vers.c file like xcode does
and include the generated file into the build on Mac OS X.

This fixes the cmake Mac OS X build after an earlier change
by Jason Molenda.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 243072
2015-07-24 00:13:45 +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
Enrico Granata fe563d5573 Several improvements to the Either<T,U> type
llvm-svn: 243053
2015-07-23 22:17:39 +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
Tamas Berghammer e2da072617 Remove XFAIL from ReturnValueTestCase after rL242972
llvm-svn: 243000
2015-07-23 09:49:59 +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
Bruce Mitchener 5a95b0a043 [lldb-mi] Remove unwanted comment blocks.
Summary:
This removes Authors:, Gotchas:, Changes: and Copyright:.

It leaves a couple of Gotcha: blocks that were not empty.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 242996
2015-07-23 09:04:56 +00:00
Dawn Perchik 509933ca56 Fix comment in test.
llvm-svn: 242979
2015-07-23 02:15:55 +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
Jason Molenda 5d935e8d24 Fix the variable used to reply to the qGDBServerVersion
packet so that debugserver will send a reply like

name:debugserver;version:340.99;

<rdar://problem/21933963> 

llvm-svn: 242968
2015-07-22 23:42:54 +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
Chaoren Lin 0b8bb3da08 Xtimeout TestProcessAttach for Linux.
llvm-svn: 242932
2015-07-22 20:52:17 +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 8c2afa0cd5 Improved the packet dumper to escape the response string before sending it to the response functions (find any 0x7d characters and remove it and XOR the next character with 0x20). This allows us to parse the JSON in the reply packet and display it correctly.
llvm-svn: 242928
2015-07-22 20:12:58 +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
Greg Clayton 97f9e40e3a Don't water JSONGenerator objects down into ObjectSP's too early so that we can call member functions specific to dictionaries and arrays without calling GetAsDictionary() or GetAsArray() on them.
llvm-svn: 242917
2015-07-22 18:15:30 +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
Bruce Mitchener 2c674d347e [lldb-mi] Remove unused bool results.
Summary:
Many methods, in particular various 'Add' methods didn't have
any actual failure scenarios that were being emitted. This meant
that a lot of surrounding code could be simplified.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242911
2015-07-22 17:07:27 +00:00
Tamas Berghammer c3a2118c39 XFAIL TestReturnValue on Linux-x86_64 with clang
The coverage of the test got increased and it fails because of it.

llvm-svn: 242910
2015-07-22 16:59:18 +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
Bruce Mitchener 20370bade9 [lldb-mi tests] Fix typo of sensitive.
llvm-svn: 242900
2015-07-22 13:46:32 +00:00
Tamas Berghammer 050d1e8a34 XFAIL watchpoint tests on Android arm/aarch64
Differential revision: http://reviews.llvm.org/D11409

llvm-svn: 242887
2015-07-22 11:00:06 +00:00
Ravitheja Addepally 78f64f3ef2 Test commit
llvm-svn: 242876
2015-07-22 08:41:18 +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
Enrico Granata ccc025b9fe Add an Either<T,U> type to lldb_utility which represents a type-safe payload of either one type or another, à la Haskell
llvm-svn: 242867
2015-07-22 02:06:37 +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
Chaoren Lin f8e102da6a Xfail test_dyld_library_path for Android.
Originally, the source for the hidden lib_d and the regular lib_d were the same
file, so we always got the "correct" source for each. Splitting them up in
D11367 exposed a bug of showing the incorrect source file for the hidden lib_d.

llvm-svn: 242862
2015-07-22 01:17:51 +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
Chaoren Lin 5699eed608 Xfail TestGdbRemoteAbort for Android API <= 16.
Reviewers: sivachandra

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242815
2015-07-21 17:50:52 +00:00
Chaoren Lin 06ebba4fe5 Re-enable static Android build after build master restart.
llvm-svn: 242814
2015-07-21 17:50:49 +00:00
Chaoren Lin 29449150e5 Update TestLoadUnload to use base Makefile.
Summary:
The current Makefile scheme only allows one dylib to be specified in each make
invocation, so TestLoadUnload had a custom Makefile that's unrelated to the
base Makefile.rules. This change uses recursive make invocations to bypass the
single dylib restriction. See D11202 for more context.

Reviewers: clayborg

Subscribers: chaoren, lldb-commits

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

llvm-svn: 242813
2015-07-21 17:50:16 +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
Bruce Mitchener 39e8823f84 [lldb-mi] Correct file names in first line comments.
llvm-svn: 242781
2015-07-21 13:09:39 +00:00
Bruce Mitchener dec98e1c84 [lldb-mi] Fix Windows build, missing assert.h include.
Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 242778
2015-07-21 12:39:58 +00:00
Bruce Mitchener 8d60fac5ba [lldb-mi] Simplify MICmnMIResultRecord implementation.
Summary:
* Remove extraneous members that were just storing temporary
  values.
* ResultClass_e parameters don't need to be const as they are
  scalars.
* Switch from a map with CMIUtilString values to using a mapping
  function. This uses a switch statement which will generate
  a warning if a new result class is added.
* Make BuildRecordResult a static function rather than a private
  member function so that we can construct the result text
  correctly and avoid having extra stuff in the header.
* Don't need (void) parameter lists in C++.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 242769
2015-07-21 11:30:39 +00:00
Bruce Mitchener 81457feffb [lldb-mi] Remove unused portions of MIDataTypes.h.
Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242768
2015-07-21 11:27:40 +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 d0bf831310 Fix incorrect documentation directives and some parameters
Differential Revision: http://reviews.llvm.org/D11379

Patch by Eugene Zelenko.

llvm-svn: 242765
2015-07-21 09:37:43 +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
Bruce Mitchener 6268bacc0f [lldb-mi] size_t rather than MIuint for arg counts.
Summary: [lldb-mi] size_t rather than MIuint for arg counts.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242762
2015-07-21 08:07:27 +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
Chaoren Lin 52fd3bf15a Fix whitespace in Android.cmake.
llvm-svn: 242717
2015-07-20 21:46:23 +00:00
Chaoren Lin ca92fb097b [Android] Only enable evil libdl.a hack when building statically.
llvm-svn: 242716
2015-07-20 21:46:20 +00:00
Greg Clayton a542e08c85 Fix the yellow colorizing and fix some logic in the "A" packet dumper.
llvm-svn: 242709
2015-07-20 21:22:18 +00:00
Ying Chen 93190c4c0b Enable timeout on Windows
Summary: - launch dotest with gtimeout if found on Windows

Reviewers: chaoren

Subscribers: lldb-commits

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

llvm-svn: 242699
2015-07-20 20:04:22 +00:00
Chaoren Lin 384db3ab16 Revert static Android build until build master restarts.
llvm-svn: 242688
2015-07-20 17:35:52 +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
Chaoren Lin 857a43c70a Add evil hack to workaround the missing libdl.a in the Android toolchain.
Reviewers: vharron, ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242599
2015-07-18 01:09:43 +00:00
Chaoren Lin e9bbabcc69 Apply Android -pie switch to buildDefault as well.
Reviewers: ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242598
2015-07-18 00:37:55 +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
Greg Clayton a7a5e5a684 Handle dumping many more packet types including the A packet, qC, QSetDisableASLR, qLaunchSuccess and QLaunchArch.
llvm-svn: 242586
2015-07-17 23:08:14 +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
Chaoren Lin 9070f53079 Detect if necessary to build inferior with -pie for Android.
Summary:
- Add target_is_android check (with cached results).
- Make android_device_api also cache results.
- Also removes the need to pass --env OS=Android when testing against Android.

Reviewers: sivachandra, tberghammer, clayborg, danalbert

Subscribers: chaoren, tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242580
2015-07-17 22:13:29 +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
Chaoren Lin 636a0e3836 Check if altsep exists before replace.
llvm-svn: 242576
2015-07-17 21:40:11 +00:00
Chaoren Lin f355eda567 Handle altsep ('/' on Windows) in compiler path for log files.
Reviewers: chying

Subscribers: lldb-commits

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

llvm-svn: 242575
2015-07-17 21:37:26 +00:00
Enrico Granata b873e84bd9 Make this test case be somewhat less verbose when not asked to
llvm-svn: 242573
2015-07-17 21:11:46 +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
Greg Clayton 205d6189b4 Added support for dumping 'x', 'X', 'qSymbol' packets. Also dump any XML retrieved from a qXfer packets.
llvm-svn: 242566
2015-07-17 20:16:50 +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
Enrico Granata 4cb0ba311a Split the portion of the data-formatter-objc test case that deals with NSString into its own separate test case
llvm-svn: 242552
2015-07-17 17:54:39 +00:00
Pavel Labath 6512cad8e5 Standalone cmake build improvements (bug #23889)
patch by Eugene Zelenko.

llvm-svn: 242529
2015-07-17 15:50:48 +00:00
Pavel Labath 4a0d7bcaa7 Fix liblldb linking on RHEL 6 (bug #24140)
Patch by Eugene Zelenko.

llvm-svn: 242525
2015-07-17 15:26:27 +00:00
Tamas Berghammer 022622f1d4 Improve conditional opcode handling in emulation based unwinding
Don't chane the CFI information when a conditional instruction
is emulated (eg.: popeq {r0, pc}) because the CFI for the next
instruction should be the same as the CFI for the current instruction.

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

llvm-svn: 242519
2015-07-17 11:44:14 +00:00
Pavel Labath e4fc4ef463 [LLGS] Limit jThreadsInfo to only the most important registers for now
Summary:
It seems that reading of register data is the biggest bottleneck in LLGS at the moment. Sending
four registers instead of the full GPR set increases the jThreadsInfo processing time about
6-fold. Until we figure out where is this time going, this commit limits the amount of data we
send to provide a more fluid debugging experience.

Reviewers: tberghammer, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 242517
2015-07-17 10:27:42 +00:00
Pavel Labath f3898c30e6 [MainLoop] Fix assertion failure
Upon connection termination the waitable handle of an IOObject gets reset to an invalid handle.
This caused a problem since we used the object->GetWaitableHandle as a key to the set of
registered events. The fix is to use something more immutable as a key: we make a copy of the
original waitable handle, instead of holding onto the IOObject.

llvm-svn: 242515
2015-07-17 10:08:38 +00:00
Enrico Granata 8101f570f8 Teach the std::wstring data formatter how to properly display strings with embedded NUL bytes
llvm-svn: 242501
2015-07-17 01:56:25 +00:00
Enrico Granata d07f7550a9 Add StringPrinter support for printing a std::string with embedded NUL bytes
llvm-svn: 242496
2015-07-17 01:03:59 +00:00
Greg Clayton b2273bd3d6 Allow gdbremote.py to take input from STDIN and handle "c" and "s" packets.
llvm-svn: 242490
2015-07-17 00:19:31 +00:00
Chaoren Lin 109ef8cf6b Re-landing r242318 after buildbot update.
llvm-svn: 242488
2015-07-16 23:45:08 +00:00
Chaoren Lin 594896fc8a Xfail pexpect tests for Windows hosts.
llvm-svn: 242457
2015-07-16 22:24:16 +00:00
Greg Clayton b887da1db3 Make sure we calculate resolver symbol addresses correctly for ARM. The trie entries have bit 0 set for Thumb functions and we need to remove that so we can correctly determine which symbols are resolvers.
<rdar://problem/21396553>

llvm-svn: 242435
2015-07-16 19:50:57 +00:00
Pavel Labath 8c0970febd Fix compiler warning in ThreadPlanStepRange
llvm-svn: 242403
2015-07-16 14:21:49 +00:00
Pavel Labath 4a4bb12e0d Add jThreadsInfo support to lldb-server
Summary:
This commit adds initial support for the jThreadsInfo packet to lldb-server. The current
implementation does not expedite inferior memory.  I have also added a description of the new
packet to our protocol documentation (mostly taken from Greg's earlier commit message).

Reviewers: clayborg, ovyalov, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 242402
2015-07-16 14:14:35 +00:00
Tamas Berghammer a0cd89a445 Revert "Default to linking lldb-server statically for Android."
With static linking lldb-server crashes in platform mode when
tries to listen on localhost:5432 on the android build bot.

This reverts commit 3ea861707dec8423746679ff496e4fd03255d4cf.

llvm-svn: 242401
2015-07-16 14:13:01 +00:00
Pavel Labath 07695bd3ae Fix compiler warning in ArchSpec
llvm-svn: 242397
2015-07-16 13:11:34 +00:00
Tamas Berghammer 287531894a Add missing include for android-arm build
llvm-svn: 242396
2015-07-16 12:35:04 +00:00
Tamas Berghammer 628365435d Improve XFAIL for test_lldb_process_load_and_unload_commands
llvm-svn: 242392
2015-07-16 10:00:06 +00:00
Pavel Labath 5abe726911 Revert "[NativeProcessLinux] Integrate MainLoop"
This seems to be causing major slowdows on the android buildbot. Reverting while I investigate.

llvm-svn: 242391
2015-07-16 08:45:03 +00:00
Jaydeep Patil 501a781998 [LLDB][MIPS] Detect MIPS application specific extensions like micromips
SUMMARY:
    The patch detects MIPS application specific extensions (ASE) like micromips by reading 
    ELF header.e_flags and SHT_MIPS_ABIFLAGS section. MIPS triple does not contain ASE 
    information like micromips, mips16, DSP, MSA etc. These can be read from header.e_flags 
    or SHT_MIPS_ABIFLAGS section.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11133

llvm-svn: 242381
2015-07-16 03:51:55 +00:00
Jason Molenda d25d72fb79 Only include the stack memory for the caller stack
frame, don't go any further, in RNBRemote::SendStopReplyPacketForThread.

These are the memory pre-fetches in the T05 packet and are
included in every private stop that lldb does.  lldb needs, at most,
the caller stack frame so we're sending more data than needed by
including additional stack memory prefetches in this reply packet.

Once we've stopped for a public stop, we're going to do a jThreadsInfo
which will include the stack memory prefetches for all threads, 
including the one which had the stop reason.

llvm-svn: 242380
2015-07-16 03:42:40 +00:00
Jason Molenda 86a86cf725 Build ValueObjectConstResultCast.cpp.
llvm-svn: 242379
2015-07-16 03:38:17 +00:00
Siva Chandra f8877efc8b Add a class ValueObjectConstResultCast.
Summary:
Other changes around the main change include:

1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl
and ValueObjectConstResultChild.

2. Add an argument |live_address| of type lldb::addr_t to the constructor
of ValueObjectConstResultChild. This is passed on to the backing
ValueObjectConstResultImpl object constructor so that the address of the
child value can be calculated properly.

Reviewers: granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 242374
2015-07-16 01:47:12 +00:00
Greg Clayton a5801ade5a Added the ability to get JSON thread stop info with thread ID and stop info only in the normal stop reply packets using the new "jthreads" key value pair.
This allows stepping operations that don't ever do a public stop to get all the info they need without having to send a jThreadsInfo packet since those tend to be large.

This patch will be followed by a patch that will detect when we do a public stop, and when that happens we will send a jThreadsInfo packet at that time to get all expedited registers and memory.

llvm-svn: 242352
2015-07-15 22:59:03 +00:00
Keno Fischer ac351b7943 [Makefiles] One more library rename to align with CMake
This one I accidentally missed last time because I confused it with
the lldbUtility library. After this, all makefile libraries should
have the same names as their CMake counterparts.

llvm-svn: 242344
2015-07-15 22:39:44 +00:00
Chaoren Lin 00d4fe43c6 Remove shell-specific code from TestLoadUnload Makefile.
Reviewers: clayborg, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 242332
2015-07-15 21:18:26 +00:00
Chaoren Lin e271658ec1 Use accept instead of accept4 for Android.
Summary:
The accept4 syscall is missing on older ARM Android kernels, and the accept()
call is implemented with the accept4 syscall, so we'll need to call the accept
syscall directly.

Reviewers: vharron, tberghammer, labath

Subscribers: ovyalov, chaoren, labath, tberghammer, aemerson, lldb-commits

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

llvm-svn: 242319
2015-07-15 19:22:12 +00:00
Chaoren Lin f7ee0870ae Default to linking lldb-server statically for Android.
Reviewers: vharron, tberghammer

Subscribers: chaoren, labath, tberghammer, lldb-commits

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

llvm-svn: 242318
2015-07-15 19:22:09 +00:00
Dawn Perchik a3ff7032c8 Fix -data-info-line when source includes column number.
This fixes an off-by-one bug in CMICmdCmdDataInfoLine::Acknowledge.  Given:
    LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:123:1
-data-info-line would report the line as 12, omitting the last digit.

Reviewed by: ki.stfu, abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11209

llvm-svn: 242306
2015-07-15 17:25:01 +00:00
Pavel Labath 827965c33c [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

llvm-svn: 242305
2015-07-15 17:20:01 +00:00
Jim Ingham 4920a4ef56 Fix another little nit with detach and keep stopped, you have to check
both for packet success and that the response is OK.

llvm-svn: 242262
2015-07-15 00:59:25 +00:00
Jason Molenda 2a66738f5c Correct length of packet that GDBRemoteCommunicationClient::Detach
should send when detaching and leaving the remote process/system
halted.  Previously only the 'D' initial char was sent, which
resumed the process like a normal detach.

llvm-svn: 242256
2015-07-15 00:16:09 +00:00
Jason Molenda 25c34d9464 Small fix to ThreadPlanStepRange::DumpRanges to logging
output when stepping through multiple ranges.

llvm-svn: 242243
2015-07-14 23:17:29 +00:00
Dawn Perchik 4154ad467b Cleanup; remove trailing spaces.
llvm-svn: 242214
2015-07-14 22:12:43 +00:00
Keno Fischer 2069de9813 [Makefiles] Align library names with CMake build
Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames.

Reviewers: labath

Subscribers: emaste, tberghammer, lldb-commits

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

llvm-svn: 242196
2015-07-14 20:25:19 +00:00
Jason Molenda fea7765219 Add comment explaning sanity check on packet size in the packet decompression method.
llvm-svn: 242184
2015-07-14 19:19:07 +00:00
Oleksiy Vyalov a3f245fff0 Use target.exec-search-paths setting when resolving executable path for remote target.
http://reviews.llvm.org/D11163

llvm-svn: 242183
2015-07-14 18:59:32 +00:00
Oleksiy Vyalov df62ed3f8b Fix temp port file path generation in lldb-platform.
http://reviews.llvm.org/D11152

llvm-svn: 242182
2015-07-14 18:54:52 +00:00
Ewan Crawford cf388ccfbc Fix LLDB Xcode build broken in r242137
llvm-svn: 242143
2015-07-14 13:29:03 +00:00
Ewan Crawford 90ff791141 Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function call on target via register manipulation
For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support. 
Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls.

In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation. 
To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter. 

The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values.

Reviewers: jingham, spyffe

Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427

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

llvm-svn: 242137
2015-07-14 10:56:58 +00:00
Kate Stone ea671fbdff Fixed line wrapping for the "long help" content in LLDB commands. Content is now dynamically wrapped for the column width of the current terminal. Lines that begin with whitespace will be indented identically on subsequent lines to maintain formatting.
Existing commands supplying this type of help content have been reworked to take advantage of the changes.  In addition to formatting changes, content was changes for accuracy and clarity purposes.
    
<rdar://problem/21269977>

llvm-svn: 242122
2015-07-14 05:48:36 +00:00
Jason Molenda 21c34ac419 Fix off-by-one error in the packet decompression routine
that would not pass through empty ("unsupported packet") replies
correctly.

llvm-svn: 242119
2015-07-14 04:51:05 +00:00
Dawn Perchik aa80814c69 Fix debugserver build breakage on Mavericks after lldb commit svn 240728
vm_kernel_page_size appears to not be defined on OSX Mavericks, so the
build fails.  This patch fixes the build by calculating the pagesize if
_VM_PAGE_SIZE_H_ is not defined.

llvm-svn: 242114
2015-07-14 03:50:10 +00:00
Chaoren Lin e515a5a672 Fix FreeBSD build.
llvm-svn: 242113
2015-07-14 03:18:23 +00:00
Chaoren Lin 98d0a4b39a Refactor Unix signals.
Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.

Reviewers: ovyalov, clayborg

Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits

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

llvm-svn: 242101
2015-07-14 01:09:28 +00:00
Adrian McCarthy 6c40c5e031 Fix Windows build break related to MainLoop.
llvm-svn: 242079
2015-07-13 22:35:44 +00:00
Greg Clayton 3ca8f429b1 Don't crash if we are unable to get the member type.
<rdar://problem/21624447>

llvm-svn: 242076
2015-07-13 22:08:16 +00:00
Dawn Perchik 6145ad2d36 [lldb-mi] Add const qualifier to vMITextLine in InterpretCommandThisDriver.
llvm-svn: 242057
2015-07-13 20:16:13 +00:00
Pavel Labath b6fddcd735 Avoid dependency on uuid.h in MacOSXDYLD
Summary:
r241964 has added a dependency on uuid.h, which (on linux at least) necessitates instalation of a
new package. Since the only thing we need from that file is uuid_t (and this is already defined
in UuidCompatibility.h), we can avoid this dependency by making this include __APPLE__ specific.
If in future, we need more from this library, we can revisit this decision.

Reviewers: jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 242022
2015-07-13 12:27:28 +00:00
Tamas Berghammer 5f0bc1a859 Remove hack about the size of long doubles from DataExtractor
The size of a long double was hardcoded in DataExtractor for x86 and
x86_64 architectures. This CL removes the hard coded values and use the
actual size based on the floating point semantics specified.

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

llvm-svn: 242019
2015-07-13 10:50:55 +00:00
Pavel Labath 77dc9569c6 Introduce a MainLoop class and switch llgs to use it
Summary:
This is the first part of our effort to make llgs single threaded. Currently, llgs consists of
about three threads and the synchronisation between them is a major source of latency when
debugging linux and android applications.

In order to be able to go single threaded, we must have the ability to listen for events from
multiple sources (primarily, client commands coming over the network and debug events from the
inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop.
A main loop has the ability to register callback's which will be invoked upon receipt of certain
events. MainLoopPosix has the ability to listen for file descriptors and signals.

For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop
instead of waiting on the network socket directly, but the other threads still remain. In the
followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining
threads.

Reviewers: ovyalov, clayborg, amccarth, zturner, emaste

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 242018
2015-07-13 10:44:55 +00:00
Tamas Berghammer c9627aeae6 Skip oatdata and oatexec symbols in system@framework@boot.oat
On Android the oatdata and the oatexec symbols in
system@framework@boot.oat covers the full .text section what causes
issues with displaying unusable symbol name to the user and very slow
unwinding speed because the instruction emulation based unwind plans
try to emulate all instructions in these symbols. Don't add these
symbols to the symbol list as they have no use for the debugger and
they are causing a lot of trouble.

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

llvm-svn: 242017
2015-07-13 09:54:41 +00:00
Sagar Thakur 6bee961a2e [LLDB][MIPS] Add mips cores in cores_match () in ArchSpec
This patch:
        - Allows mips32 cores to match with any mips32/mips64 cores.
        - Allows mips32r2 cores to match with core only up-to mips32r2/mips64r2.
        - Allows mips32r3 cores to match with core only up-to mips32r3/mips64r3.
        - Allows mips32r5 cores to match with core only up-to mips32r3/mips64r5.
        - Allows mips32r6 core to match with only mips32r6/mips64r6 or mips32/mips64.

Reviewers: emaste, jaydeep, clayborg
Subscribers: mohit.bhakkad, nitesh.jain, bhushan, lldb-commits
Differential Revision: http://reviews.llvm.org/D10921

llvm-svn: 242016
2015-07-13 09:52:06 +00:00
Jason Molenda 20ee21bde6 Add a another packet to the gdb-remote protocol,
jGetLoadedDynamicLibrariesInfos.  This packet is similar to
qXfer:libraries:read except that lldb supplies the number of solibs
that should be reported about, and the start address for the list
of them.  At the initial process launch we'll read the full list
of solibs linked by the process -- at this point we could be using
qXfer:libraries:read -- but on subsequence solib-loaded notifications,
we'll be fetching a smaller number of solibs, often only one or two.

A typical Mac/iOS GUI app may have a couple hundred different 
solibs loaded  - doing all of the loads via memory reads takes 
a couple of megabytes of traffic between lldb and debugserver.
Having debugserver summarize the load addresses of all the solibs
and sending it in JSON requires a couple of hundred kilobytes
of traffic.  It's a significant performance improvement when 
communicating over a slower channel.

This patch leaves all of the logic for loading the libraries
in DynamicLoaderMacOSXDYLD -- it only call over ot ProcesGDBRemote
to get the JSON result.

If the jGetLoadedDynamicLibrariesInfos packet is not implemented,
the normal technique of using memory read packets to get all of
the details from the target will be used.

<rdar://problem/21007465>

llvm-svn: 241964
2015-07-10 23:15:22 +00:00
Greg Clayton bf91f712b3 Don't try to make a pseudo terminal if we are launching in a separate terminal, it causes a deadlock when debugging because we create a PTY and yet it isn't hooked up to anything on the slave side.
llvm-svn: 241919
2015-07-10 18:04:46 +00:00
Sean Callanan 9ff456c8a2 Fixed a problem where variables in modules were not appropriately discovered by
the expression parser.

<rdar://problem/21395220>

llvm-svn: 241917
2015-07-10 17:34:23 +00:00
Greg Clayton fdbff2afed Don't let a test fail because of a teardown command returning an error. Use a function that doesn't check the return value.
llvm-svn: 241879
2015-07-10 00:30:22 +00:00
Chaoren Lin 1bd3c9abd8 Fix 32-bit Linux watchpoint failures.
Summary:
32-bit signed return value from ptrace got sign extended when being converted to
64-bit unsigned.

Also, replaced tabs with spaces in the source.

Reviewers: labath, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241837
2015-07-09 18:35:16 +00:00
Keno Fischer 964a5c59f8 Unbreak Makefile build
llvm-svn: 241820
2015-07-09 17:09:09 +00:00
Pavel Labath d5b310f2a3 Avoid going through Platform when creating a NativeProcessProtocol instance
Summary:
This commit avoids the Platform instance when spawning or attaching to a process in lldb-server.
Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason
for this is that I believe that NativeProcessProtocol should be decoupled from the Platform
(after all, it always knows which platform it is running on, unlike the rest of lldb).
Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ
greatly from the platform actions of the lldb client, so I think the separation makes sense.

After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable
method, which needs additional refactoring.

This is a resubmit of r241672, after it was reverted due to build failueres on non-linux
platforms.

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241796
2015-07-09 11:51:11 +00:00
Pavel Labath 89ad594075 Fix TestStopHookMultipleThreads and TestNamespace after r241751
The mentioned commit introduced a subtle change in behavior when printing variable names. This
occured when we have a variable, for which we only know the demangled name, because the compiler
has failed to provide one (this typically happens for variables in anonymous namespaces). A
Mangled class which contains only a demangled name considers itself to be invalid (this could
possibly be a bug), but it's GetName() method still returns a valid demangled name. The previous
commit introduced the check for the validity of the class, and if it failed, it would fall back
to printing the bare name (without the namespace prefixes, as the tests were expecting). I revert
this part of the commit and check the validity of the string returned by GetName() instead.

llvm-svn: 241795
2015-07-09 10:57:54 +00:00
Bruce Mitchener 0a07397433 [lldb-mi] Remove unused typedefs.
Summary: [lldb-mi] Remove unused typedefs.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241791
2015-07-09 08:45:26 +00:00
Greg Clayton ddaf6a7259 Make many mangled functions that might demangle a name be allowed to specify a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so.
llvm-svn: 241751
2015-07-08 22:32:23 +00:00
Greg Clayton 1eb778fc2b Unbreak the MacOSX build.
llvm-svn: 241749
2015-07-08 22:21:22 +00:00
Stephane Sezer 9a7cacb5f6 Implement qXfer:libraries:read.
Summary:
This is used on non-unix platforms, where qXfer:libraries-svr4:read
doesn't make sense. Windows uses that for instance.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 241712
2015-07-08 19:14:03 +00:00
Oleksiy Vyalov c8a3e9273c Try to enable TestProcessAttach tests on Linux.
http://reviews.llvm.org/D11013

llvm-svn: 241702
2015-07-08 18:15:32 +00:00
Stephane Sezer 38a1b7ea58 Move WindowsDYLD to the Plugins/DynamicLoader directory.
Summary:
This commit moves the Windows DyanamicLoader to the common DynamicLoader
directory. This is required to remote debug Windows targets.

This commit also initializes the Windows DYLD plugin in
SystemInitializerCommon (similarly to both POSIX and MacOSX DYLD
plugins) so that we can automatically instantiate this class when
connected to a windows process.

Test Plan: Build.

Reviewers: zturner

Subscribers: lldb-commits, abdulras

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

llvm-svn: 241697
2015-07-08 18:07:13 +00:00
Sean Callanan 83b8ad0eaa Fixed a serious bug in DeportType where the types could retain DeclContexts that
pointed into the artificial function constructed for the expression.  I now make
anything that pointed to the function as its DeclContext be global while the
copy occurs; afterward I restored the old DeclContext.

Added a testcase that make sure that this works properly and doesn't crash
anything.

<rdar://problem/21049838>

llvm-svn: 241695
2015-07-08 18:03:41 +00:00
Sean Callanan c307c27035 Revert r241672, which breaks the OS X build by introducing a dependency on
platform-specific symbols that are not implemented on OS X.

The build error that caused this is

Undefined symbols for architecture x86_64:
  "lldb_private::NativeProcessProtocol::Attach(unsigned long long, lldb_private::NativeProcessProtocol::NativeDelegate&, std::__1::shared_ptr<lldb_private::NativeProcessProtocol>&)", referenced from:
      lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::AttachToProcess(unsigned long long) in liblldb-core.a(GDBRemoteCommunicationServerLLGS.o)
  "lldb_private::NativeProcessProtocol::Launch(lldb_private::ProcessLaunchInfo&, lldb_private::NativeProcessProtocol::NativeDelegate&, std::__1::shared_ptr<lldb_private::NativeProcessProtocol>&)", referenced from:
      lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess() in liblldb-core.a(GDBRemoteCommunicationServerLLGS.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

llvm-svn: 241688
2015-07-08 16:33:46 +00:00
David Srbecky d515e94070 Tolerate DWARF compile unit without filename.
Summary:
The DW_AT_name attribute of compile unit is optional.
If it is missing, try to get filename from the debug_line section.
This allows the compile unit to be useful without the filename.

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

llvm-svn: 241679
2015-07-08 14:00:04 +00:00
Pavel Labath 235c8405eb Avoid going through Platform when creating a NativeProcessProtocol instance
Summary:
This commit avoids the Platform instance when spawning or attaching to a process in lldb-server.
Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason
for this is that I believe that NativeProcessProtocol should be decoupled from the Platform
(after all, it always knows which platform it is running on, unlike the rest of lldb).
Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ
greatly from the platform actions of the lldb client, so I think the separation makes sense.

After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable
method, which needs additional refactoring.

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241672
2015-07-08 09:08:53 +00:00
Jim Ingham 22302e5995 Make command files specified to the driver actually print their
results if the -Q option is not provided.  Also took out the quietly
option from AddInitialCommand, we don't use that to set this option,
we use the override set by the -Q option.

<rdar://problem/21232087>

llvm-svn: 241652
2015-07-08 00:59:59 +00:00
Sean Callanan 007135e612 Fixed the C modules test case on Darwin by streamlining its code.
We don't need to do the fancy dance with checking whether the iterator
represents a #define -- in fact, that's the wrong thing to do.  The thing to do
is check whether the highest-priority module that did something to the module
#defined or #undefd it.  If it #defined it, then the MacroInfo* will be non-NULL
and we're good to go.

llvm-svn: 241651
2015-07-08 00:13:49 +00:00
Jim Ingham ce400d9ab4 Don't select a thread that stopped for a signal that was
not set to stop - there must be some other thread that
stopped for a more interesting reason.

<rdar://problem/19943567>

llvm-svn: 241650
2015-07-08 00:06:30 +00:00
Bruce Mitchener 4578815289 Move ProcessKDP's StringExtractor include.
This can be in the cpp file rather than the header file, so moving
it there.

Summary: Move ProcessKDP's StringExtractor include.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 241649
2015-07-07 23:59:01 +00:00
Adrian McCarthy 45c4c9b090 Windows doesn't have fork.
llvm-svn: 241640
2015-07-07 22:56:34 +00:00
Jim Ingham 763b2b26a0 Add a version of SBTarget::EvaluateExpression that doesn't require
an options (and makes an appropriate defaulted option for you.)

<rdar://problem/20639202>

llvm-svn: 241632
2015-07-07 22:12:17 +00:00
Greg Clayton a7b2690cb3 Fix debugserver build after someone moved StrintExtractor.h.
llvm-svn: 241628
2015-07-07 21:27:08 +00:00
Chaoren Lin 57fca019e4 Fix APFloat construction from 16 byte APInt.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 241606
2015-07-07 17:39:23 +00:00
Bruce Mitchener 28529f607c Fix StringExtractor.h issues.
Summary:
Fix StringExtractor.h issues.

* source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  (#include "Utility/StringExtractor.h): Not needed, this is already
    included by ProcessKDP.h

* unittests/Utility/StringExtractorTest.cpp
  (#include "Utility/StringExtractor.h): Update include path to the
    new location.

Reviewers: labath, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241596
2015-07-07 15:19:03 +00:00
Bruce Mitchener 6c971ec217 [lldb-mi] Spell resource string name correctly.
Broardcaster -> Broadcaster

Summary: [lldb-mi] Spell resource string name correctly.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241591
2015-07-07 14:54:07 +00:00
Bruce Mitchener 1f44139a4f cmake no longer needs to deal with -std=c++11 checks.
LLVM requires and handles this now and has the correct compiler
version checks. This block of code for cmake in LLDB is no longer
needed.

Summary: cmake no longer needs to deal with -std=c++11 checks.

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 241590
2015-07-07 14:52:59 +00:00
Adrian McCarthy 137d7ba8b2 Fix _LocalProcess.terminate on Windows.
llvm-svn: 241589
2015-07-07 14:47:34 +00:00
Bruce Mitchener c5638f915b [lldb-mi] Fix typo in variable name.
Seperated -> Separated.

Summary: [lldb-mi] Fix typo in variable name.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241586
2015-07-07 14:26:28 +00:00
Bruce Mitchener ae4c026765 [lldb-mi] Fix typos
llvm-svn: 241585
2015-07-07 14:04:40 +00:00
Pavel Labath be9f9c177a Enclose CLANG_USED_LIBS in --start/end-group when linking liblldb (bug #24044)
Patch by Eugene Zelenko.

llvm-svn: 241576
2015-07-07 12:24:33 +00:00
Pavel Labath df0ee89d45 LLDB standalone build: check if Clang was built independently from LLVM
This is fix for bug 23704: LLDB standalone build always include
ClangConfig.cmake even if Clang was built with LLVM (ClangConfig.cmake
doesn't exist).

Patch by: Eugene Zelenko

llvm-svn: 241575
2015-07-07 12:08:09 +00:00
Pavel Labath 066fc8b194 Fix-up ProcessKDP wrt. StringExtractor move
llvm-svn: 241574
2015-07-07 11:00:55 +00:00
Pavel Labath 67add94108 Fix build after recent clang interface changes
llvm-svn: 241573
2015-07-07 10:11:16 +00:00
Pavel Labath f805e1905c Fix cmake build after recent JSON changes
I have moved StringExtractor.h into the include/ folder so that it can be properly included by
everyone.

llvm-svn: 241572
2015-07-07 10:08:41 +00:00
Tamas Berghammer ed1fa2084c Leave OS as unspecified unknown if it isn't specified in the ELF file
This is the redone of r238623 what was reverted with the refactor
in r239148.

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

llvm-svn: 241569
2015-07-07 09:11:59 +00:00
Jason Molenda 3f661e0899 When debugserver is running on an iOS device, call
proc_set_wakemon_params() to raise the limit on the # of wakeups
per second that are acceptable before the system may send an 
EXC_RESOURCE signal to debugserver.  

<rdar://problem/19631512> 

llvm-svn: 241553
2015-07-07 04:15:43 +00:00