Commit Graph

13801 Commits

Author SHA1 Message Date
Davide Italiano 13fe2a9517 Placate MVSC after my last commit.
Zachary introduced the 'default' case explicitly to placate a warning in
the Microsoft compiler but that broke clang with -Werror. 
The new code should keep both compilers happy.

llvm-svn: 258212
2016-01-19 22:47:51 +00:00
Davide Italiano 576dc8d27d [Process] Remove dead code. All the switch cases are already covered.
llvm-svn: 258199
2016-01-19 21:59:12 +00:00
Sean Callanan 40574bdb7a Removed a bunch of spurious files from the man page Copy Files build phase.
A few files were accidentally added to the Copy Files build phase for our man
page, and they would appear when 'xcodebuild install' was invoked.  This removes
those files – they continue to be built correctly, but they aren't installed
with our man page.

llvm-svn: 258194
2016-01-19 21:48:25 +00:00
Oleksiy Vyalov 8b85b03b06 Implementing the method Target::TargetEventData::Dump (Stream *s) so that its clients can easily dump it out for informational messages.
http://reviews.llvm.org/D16244

Submitting on behalf of vishwesh@google.com.

llvm-svn: 258150
2016-01-19 17:54:47 +00:00
Ravitheja Addepally 15f89c420b Fix for Bug 25338
Summary:
The issue arises because LLDB is not
able to read the vdso library correctly.
The fix adds memory allocation callbacks
to allocate sufficient memory in case the
requested offsets don't fit in the memory
buffer allocated for the ELF.

Reviewers: lldb-commits, clayborg, deepak2427, ovyalov, labath, tberghammer

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

llvm-svn: 258122
2016-01-19 12:55:21 +00:00
Pavel Labath f82d71f025 Remove last XTIMEOUTs from android tests
TestHelloWorld seems to be passing now as far as I can tell. TestExitDuringStep is still hanging.
I have marked the relevant tests as flaky, which should handle the timeouts now as well. I'll be
monitoring the buildbots for fallout.

llvm-svn: 258114
2016-01-19 10:59:10 +00:00
Tamas Berghammer 8c6996f737 Unconditionally accept symbol sizes from elf
The ELF symbol table always contain the size of the symbols so we
don't have to try to guess them based on the address of the next
symbol (it is needed for mach-o).

The change fixes an issue when a symbol is removed after a 0 size
symbol (e.g. because the second one is not public) what previously
caused the symbol lookup algorithm to end up with showing the 0 size
symbol even for the later addresses (what are not part of any symbol).
That symbol lookup error can confuse the user and also confuses the
current stack unwinder.

Re-commit this CL after fixing the issue with gcc-4.9.2 on i386 Linux.

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

llvm-svn: 258113
2016-01-19 10:24:51 +00:00
Rafael Espindola a94ae1e05b Update for llvm change. NFC.
llvm-svn: 258080
2016-01-18 20:57:54 +00:00
Pavel Labath bace94eda8 Remove skipIfLinuxClang decorator
it isn't used in the code anymore, and we're trying to cut down on the decorators.

llvm-svn: 258049
2016-01-18 15:01:14 +00:00
Pavel Labath 4da73573ab Guard against application of an XFAIL decorator on a class
This does not work and causes the class to be silently skipped, which is a bad idea. This makes
sure it cannot happen accidentaly. I've played with the idea of actually making the decorator
work at class level, but it proved too magic to do at this moment.

llvm-svn: 258048
2016-01-18 14:45:35 +00:00
Tamas Berghammer dcad424cd3 Revert "Unconditionally accept symbol sizes from elf"
It causes issues for i386 when compiling with gcc-4.9.2

This reverts commit e248214a3eab8e244095f97d1996c991cb988cc4.

llvm-svn: 258043
2016-01-18 11:49:18 +00:00
Tamas Berghammer 6b2322fb4c Unconditionally accept symbol sizes from elf
The ELF symbol table always contain the size of the symbols so we
don't have to try to guess them based on the address of the next
symbol (it is needed for mach-o).

The change fixes an issue when a symbol is removed after a 0 size
symbol (e.g. because the second one is not public) what previously
caused the symbol lookup algorithm to end up with showing the 0 size
symbol even for the later addresses (what are not part of any symbol).
That symbol lookup error can confuse the user and also confuses the
current stack unwinder.

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

llvm-svn: 258040
2016-01-18 10:38:34 +00:00
Ewan Crawford 836d965168 [RenderScript] Remove mips specific expressions
Reverts earlier commit r254910, which used function pointers for jitted expressions
to avoid a Mips64 compiler bug. Bug has since been fixed, and compiler longer issues the problem instruction.

Author: Dean De Leo <dean@codeplay.com>
llvm-svn: 258038
2016-01-18 09:16:02 +00:00
Zachary Turner 778cec3e30 On non-Windows platforms, asm int 3 generates an eStopReasonSignal.
llvm-svn: 257959
2016-01-15 23:44:45 +00:00
Zachary Turner fa0b4b271a Fix TestDebugBreak.py.
We can't assume that the main thread of an inferior has index 0,
even in a single-threaded app.

llvm-svn: 257946
2016-01-15 22:22:40 +00:00
Zachary Turner 21da1ed15b Fix ResourceWarning about unclosed file in use_lldb_suite_root.py.
llvm-svn: 257945
2016-01-15 22:22:35 +00:00
Adrian McCarthy 8801145ad4 Small fixes to ensure TestLogging.py tests work with Python 3.5 as well as 2.7.
llvm-svn: 257931
2016-01-15 20:45:06 +00:00
Ryan Brown 47d072ca48 Implement missing GoASTContext methods
llvm-svn: 257926
2016-01-15 19:35:48 +00:00
Pavel Labath 0771b18257 Fix decoration of TestConcurrentEvents
TestConcurrentEvents was marked with a XFAIL decorator at class level, which actually does not
work, and causes the class to be silently skipped everywhere. It seems that making it work at
class level is quite a difficult task, so I will just move it to the individual test methods. I
will follow this up with a commit which makes the decorator blow up in case someone tries to
apply it to a class in the future.

llvm-svn: 257901
2016-01-15 16:20:01 +00:00
Jim Ingham cc4609a26b The ASAN report fetching code had two latent bugs:
1) It was forward declaring functions without 'extern "C"'.  That used to work
   but only because of another bug in how we passes symbol only function names to the
   compiler and stopped working recently.
2) These forward declarations were in the body of the User Expression, and they actually
   need to go in the prefix file.

<rdar://problem/24177689>

llvm-svn: 257852
2016-01-15 01:03:50 +00:00
Adrian McCarthy aa1f270151 Fix detection of teardown hooks that are already bound.
llvm-svn: 257829
2016-01-14 22:52:16 +00:00
Sean Callanan e594268e37 Removed a redundant function call after review.
llvm-svn: 257818
2016-01-14 22:05:26 +00:00
Sean Callanan b0300a4c30 Enable the use of modules in the expression parser by default.
If your program refers to modules (as indicated in DWARF) we will now try to
load these modules and give you access to their types in expressions.  This used
to be gated by a setting ("settings set target.auto-import-clang-modules true")
but that setting defaulted to false.  Now it defaults to true -- but you can
disable it by toggling the setting to false.

llvm-svn: 257812
2016-01-14 21:46:09 +00:00
Zachary Turner 1d89df0998 Resubmit the fixes for TestProcessLaunch.py.
I was calling the base class tearDown() function the wrong way
which for some reason is ok on Python 3 but not on Python 2.

llvm-svn: 257788
2016-01-14 19:14:02 +00:00
Sean Callanan 9b0cfe2510 Fixed a crasher when dealing with table entries that have blank names.
This can happen with -gmodules tables when an anonymous struct is referred to.

llvm-svn: 257786
2016-01-14 18:59:49 +00:00
Aidan Dodds e09c44b6ff [RenderScript] Hook kernel invocation.
This patch adds a hook to track kernel invocations and to track all script and allocation objects used.

llvm-svn: 257772
2016-01-14 15:39:28 +00:00
Tamas Berghammer f84df99520 Update some XFAILs after the 3.8->3.9 version change
llvm-svn: 257761
2016-01-14 12:49:48 +00:00
Ewan Crawford d0d85d22f8 Fix ambiguous resolution of clang::ArrayType/llvm::ArrayType in ClangAstContext
Both llvm and clang have an ArrayType class, which can cause resolution to fail when llvm headers that are implicitly included name this type.
source/Symbol/ClangASTContext.cpp has 'using namespace llvm;' and 'using namespace clang;' 

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D16155

llvm-svn: 257759
2016-01-14 12:18:09 +00:00
Tamas Berghammer 3fa2395aa5 XFAIL TestCommandScriptImmediateOutput on Linux
llvm-svn: 257755
2016-01-14 10:56:56 +00:00
Todd Fiala 02fe4b9334 change Xcode test run default to ignore xpass on Xunit output
The Green Dragon LLVM builders are starting to parse xunit output
on LLDB Xcode builders.  By default the XML formatter treats
xpass (unexpected successes) as failures.  The new flag added
ensures we simply ignore those for purposes of xUnit output.
LLDB is not currently XPASS clean.

llvm-svn: 257717
2016-01-13 23:55:16 +00:00
Hans Wennborg 400e1809ad Fix -Wformat-pedantic warning
/work/llvm-3.8/llvm.src/tools/lldb/source/API/SBProcess.cpp:1003:73:
error: format specifies type 'void *' but the argument has type 'lldb_private::Event *' [-Werror,-Wformat-pedantic]
        log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, event.get(), ret_val);
                                              ~~                        ^~~~~~~~~~~
1 error generated.

llvm-svn: 257692
2016-01-13 22:40:26 +00:00
Hans Wennborg 6ab018ec2e Include IR/DerivedTypes.h instead of IR/Type.h to match LLVM change r256406.
This is similar to r256407 and fixes the following warning:

In file included from /work/llvm-3.8/llvm.src/tools/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp:14:
In file included from /work/llvm-3.8/llvm.src/tools/lldb/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h:23:
/work/llvm-3.8/llvm.src/include/llvm/IR/Type.h:350:16: error: inline function 'llvm::Type::getSequentialElementType' is not defined [-Werror,-Wundefined-inline]
  inline Type *getSequentialElementType() const;
               ^
/work/llvm-3.8/llvm.src/include/llvm/IR/Type.h:353:46: note: used here
  Type *getArrayElementType() const { return getSequentialElementType(); }
                                             ^
1 error generated.

I'm not sure why it's not showing on any bots.

llvm-svn: 257691
2016-01-13 22:40:24 +00:00
Zachary Turner 400767af54 Revert changes to TestProcessLaunch.py as they are breaking a build.
llvm-svn: 257690
2016-01-13 22:32:31 +00:00
Zachary Turner d79bc32668 Rename MSVC top-level folder to avoid name collision.
If you have two folders with the same name but different cases,
MSBuild gets confused and generates an error when building
from within Visual Studio.

This patch renames it so that the cases of all folders named
"LLDB tests" match.

Patch by Jonathan Meier
Differential Revision: http://reviews.llvm.org/D16150

llvm-svn: 257684
2016-01-13 22:00:44 +00:00
Zachary Turner a505be4e5d Fix some compiler warnings with MSVC 2015.
llvm-svn: 257671
2016-01-13 21:22:00 +00:00
Zachary Turner 673cf7e80b Get rid of const char** typemaps.
We already have char** typemaps which were near copy-pastes of
the const char** versions.  This way we have only one version that
works for both.

llvm-svn: 257670
2016-01-13 21:21:54 +00:00
Zachary Turner 19e2ea8fb6 Fix TestProcessLaunch for Python 3.
There were a number of problems preventing this from working:

1. The SWIG typemaps for converting Python lists to and from C++
   arrays were not updated for Python 3.  So they were doing things
   like PyString_Check instead of using the PythonString from
   PythonDataObjects.
2. ProcessLauncherWindows was ignoring the environment completely.
   So any test that involved launching an inferior with any kind
   of environment variable would have failed.
3. The test itself was using process.GetSTDOUT(), which isn't
   implemented on Windows.  So this was changed to save the
   value of the environment variable in a local variable and
   have the debugger look at the value of the variable.

llvm-svn: 257669
2016-01-13 21:21:49 +00:00
Enrico Granata 983ad65220 Mark these tests on FreeBSD and Linux as non-flakey. We don't know that they are
llvm-svn: 257656
2016-01-13 19:29:52 +00:00
Sean Callanan f03dbb3cb5 Fixed a problem where the Xcode build put lldb's __init__.py in the wrong place.
Most of the time CONFIGURATION_BUILD_DIR and BUILT_PRODUCTS_DIR are the same,
but they are different in 'xcodebuild install' situations.  The file needs to be
put into BUILT_PRODUCTS_DIR or lldb's Python interface doesn't work when lldb is
built using 'xcodebuild install'.

llvm-svn: 257653
2016-01-13 19:23:30 +00:00
Enrico Granata 744959b9c9 Fix an issue where scripted commands would not actually print any of their output if an immediate output file was set in the result object via a Python file object
Fixes rdar://24130303

llvm-svn: 257644
2016-01-13 18:11:45 +00:00
Tamas Berghammer 808ff186f6 Silence an incorrect dwarf parsing warning
We have a check what warns if the offset of a class member is greater
then or equal to the size of the class. The warning is valid in most
case but it is invalid when the last data member is a 0 size array
because in this case the member offset can be equal to the class size
(subject to alignment limitations).

This CL fixis LLDB to not print out a warning in this special case.

llvm-svn: 257603
2016-01-13 14:58:48 +00:00
Sagar Thakur dd113648af [LLDB][MIPS] Fix TestDisassembleRawData.py
Patch by Nitesh Jain.

Summary: This patch adds check for the correctness of disassembling instruction for MIPS target.

Reviewers: emaste, clayborg, ovyalov
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: http://reviews.llvm.org/D15915
llvm-svn: 257587
2016-01-13 11:22:56 +00:00
Jason Molenda 50018d3cf5 Add a small refinement to the qSymbol:: support in lldb.
This is a packet which allows the remote gdb stub to ask for the address
of a symbol in the process.  lldb sends the packet (offering to provide
addresses for symbol names) after every solib loaded.  I changed lldb so
that once the stub has indicated that it doesn't need any more symbol
addresses, lldb will stop sending the qSymbol:: packet on new solib loads.

This can yield a performance benefit over slower communication links when
there are many solibs involved.

<rdar://problem/23310049> 

llvm-svn: 257569
2016-01-13 04:08:10 +00:00
Siva Chandra b4f94aaf9b [TestThreadJump] Adjust match sub-string after recent change.
Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 257531
2016-01-12 22:33:19 +00:00
Zachary Turner 9d59306528 Fix TestThreadJump on Windows.
The system can create threads for a system threadpool, so there is
no guarantee that the thread that is stopped is thread 1.  So use
a more robust check.

llvm-svn: 257513
2016-01-12 20:45:29 +00:00
Stephane Sezer 1307d4c7df Fix build breakage of r257502.
llvm-svn: 257510
2016-01-12 20:22:58 +00:00
Stephane Sezer 87b0fe075e Increase use of svr4 packets to improve performance on POSIX remotes
Summary:
Allows the remote to enumerate the link map when adding and removing
shared libraries, so that lldb doesn't need to read it manually from
the remote's memory.

This provides very large speedups (on the order of 50%) in total
startup time when using the ds2 remote on android or Tizen devices.

Reviewers: ADodds, tberghammer, tfiala

Subscribers: tberghammer, sas, danalbert, llvm-commits, srhines

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 257502
2016-01-12 19:02:41 +00:00
Tamas Berghammer 239132f452 Try to fix the mips64 build after rL257447
llvm-svn: 257469
2016-01-12 10:41:43 +00:00
Ravitheja Addepally 49982f5773 Fix for TestNoreturnUnwind.py on i386
Summary:
The testcase TestNoreturnUnwind.py was failing
because the unwind from the vdso library was not
successful for clang compiler while it was passing
for gcc. It was passing for gcc since the unwind plan
used was the assembly plan and the ebp register was
set by the main function in case of gcc and was not
used by the functions in the call flow to the vdso, whereas
clang did not emit assembly prologue for main and so
 the assembly unwind was failing. Normally in case of
failure of assembly unwind, lldb switches to EH CFI frame
based unwinding, but this was not happening for
the first frame. This patch tries to fix this behaviour by
falling to EH CFI frame based unwinding in case of assembly
unwind failure even for the first frame.
The test is still marked as XFAIL since it relys on the fix
of another bug.

Reviewers: lldb-commits, jingham, zturner, tberghammer, jasonmolenda

Subscribers: jasonmolenda

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

llvm-svn: 257465
2016-01-12 10:08:41 +00:00
Pavel Labath 484f0a31b3 Add clang::Type::Pipe to ClangASTContext
Summary:
Clang recently added support for an OpenCL pipe type. Adding the new type to relevant switches to
avoid warnings.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 257460
2016-01-12 08:51:28 +00:00
Jason Molenda 77f8935218 Changes to lldb and debugserver to reduce extraneous memory reads
at each public stop to improve performance a bit.  Most of the 
information lldb needed was already in the jThreadsInfo response;
complete that information and catch a few cases where we could still
fall back to getting the information via discrete memory reads.


debugserver adds 'associated_with_dispatch_queue' and 'dispatch_queue_t
keys to the jThreadsInfo response for all the threads.  lldb needs the
dispatch_queue_t value.  And associated_with_dispatch_queue helps to
identify which threads definitively don't have any queue information so
lldb doesn't try to do memory reads to get that information just because
it was absent in the jThreadsInfo response.

Remove the queue information from the questionmark (T) packet.  We'll
get the information for all threads via the jThreadsInfo response -
sending the information for the stopping thread (on all the private
stops, plus the less frequent public stop) was unnecessary information
being sent over the wire.

SystemRuntimeMacOSX will try to get information about queues by asking
the Threads for them, instead of reading memory.  

ProcessGDBRemote changes to recognize the new keys being sent in the
jThreadsInfo response.  Changes to ThreadGDBRemote to track the new
information.  Also, when a thread is marked as definitively not 
associated with a libdispatch queue, don't fall back to the system
runtime to try memory reads to find the queue name / kind / ID etc.


<rdar://problem/23309359> 

llvm-svn: 257453
2016-01-12 07:09:16 +00:00
Mohit K. Bhakkad 884fc3e4df [LLDB][MIPS] Fix rL255619: mips 3, 4 and 5 are 64 bit archs
llvm-svn: 257448
2016-01-12 06:03:01 +00:00
Mohit K. Bhakkad 64322c0331 [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size regardless of ABI
Reviewers: clayborg, tberghammer.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16060

llvm-svn: 257447
2016-01-12 05:55:03 +00:00
Bhushan D. Attarde 2be2c9a6ce [LLDB][MIPS] Merge emulation of similar instructions for MIPS64
SUMMARY:
    This patch merges emulation of similar instructions into a single function (wherever possible) to remove code duplication.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16051

llvm-svn: 257442
2016-01-12 03:56:58 +00:00
Bhushan D. Attarde def5e7df76 [LLDB][MIPS] Handle PIC calling convention for MIPS64
SUMMARY:
    This patch sets up register r25 with the address of function to be called in PrepareTrivialCall().
    This is required as per MIPS PIC calling convention.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16046

llvm-svn: 257441
2016-01-12 03:48:43 +00:00
Stephane Sezer 8dbcb63866 Get rid of ARM_ELF_SYM_IS_THUMB flag.
Summary:
This was used with the old ARM vs. Thumb detection code but is not
required anymore.

Reviewers: tberghammer, clayborg

Subscribers: fjricci, aemerson, lldb-commits, rengolin

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

llvm-svn: 257429
2016-01-12 01:12:10 +00:00
Zachary Turner 00cdc77ac9 Don't define Bytes and String to be the same number on Py2.
This is causing issues with case labels having the same value.

llvm-svn: 257409
2016-01-11 23:10:32 +00:00
Omair Javaid baa07490bc Xfail some Arm-Linux specific failures
Updated expectedFailureLinux decorator to reflect architecture

Marked some triaged failures as xfails on arm with updated expectedFailureLinux decorator

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

llvm-svn: 257405
2016-01-11 22:52:18 +00:00
Zachary Turner 7a76845c48 Fix Python 3 issues related to OS plugins.
* lldb::tid_t was being converted incorrectly, so this is updated to use
PythonInteger instead of manual Python Native API calls.
* OSPlugin_RegisterContextData was assuming that the result of
  get_register_data was a string, when in fact it is a bytes.  So this
  method is updated to use PythonBytes to do the work.

llvm-svn: 257398
2016-01-11 22:16:17 +00:00
Zachary Turner 5a72c02be9 Introduce a PythonBytes class into PythonDataObjects.
This class behaves the same as PythonString on Python2, but differently
on Python3.  Unittests are added as well.

llvm-svn: 257397
2016-01-11 22:16:12 +00:00
Zachary Turner 321b4bba76 Don't run dwo tests for windows targets.
-gsplit-dwarf is not implemented by clang on Windows.  As such,
all the dwo tests are having the -gsplit-dwarf command line option
completely ignored, and the result is you get regular dwarf debug
information, and it's just running the exact same tests twice,
doubling the length of the test suite for no good reason.

llvm-svn: 257363
2016-01-11 18:49:30 +00:00
Dimitry Andric 9a3a6ab3b6 Replace accidental DOS (and mixed) line endings in a few text files
Summary:
Similar to rL256704 and rL256707, fix a few text files which were
accidentally checked in with DOS line endings, or mixed line endings.

Reviewers: jingham, emaste

Subscribers: lldb-commits

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

llvm-svn: 257361
2016-01-11 18:07:47 +00:00
Adrian McCarthy b06107707d Fix TestMiniDump.py for Python 2/3 (and for a change to debug info)
Differential Revision: http://reviews.llvm.org/D16017

llvm-svn: 257342
2016-01-11 16:35:30 +00:00
Tamas Berghammer 1966ac36a6 Don't try to parse the line table when it isn't specified
Previously we tried to parse the line table even if a compile unit
had no DW_AT_stmt_list atribute. The problem happens when a compiler
generates debug info for a compile unit but doesn't generate any line
info.

llvm-svn: 257335
2016-01-11 14:56:05 +00:00
Pavel Labath 1623e30a35 Mark TestChangeValueAPI as flaky on linux (pr25652)
llvm-svn: 257329
2016-01-11 11:59:38 +00:00
Pavel Labath 524025bd2e Skip TestEvents on linux completely
The test hangs/crashes/fails because it does not use the listener API in a way that LLDB expects.
I don't really know if this is the fault of LLDB of the test...

llvm-svn: 257323
2016-01-11 10:55:57 +00:00
Tamas Berghammer e85e6021f0 Make the aarch64 lldb-server capable of debugging arm32 applications
Differential revision: http://reviews.llvm.org/D15533

llvm-svn: 257322
2016-01-11 10:39:09 +00:00
Pavel Labath 625e51d7a5 Remove CRLF line endings from test_common.h
llvm-svn: 257321
2016-01-11 10:27:31 +00:00
Pavel Labath d0f89cd721 Centralize the handling of attach permissions on linux in tests
Summary:
On linux we need the process to give us special permissions before we can attach to it.
Previously, the code for this was copied into every file that needed it. This moves the code to a
central place to reduce code duplication.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 257319
2016-01-11 10:24:50 +00:00
Jim Ingham 22861aeab8 Writing a test case for r257234 I found another place that was
assuming a ValueObject always has a process.  So this is that fix
and the test case.

llvm-svn: 257242
2016-01-09 01:20:30 +00:00
Jim Ingham 58a305bf15 Fiddling with Pavel's fix for getting the breakpoint right when there's debug info for sleep.
I prefer to use "-p" over using line_number and then setting by line because it's makes it possible
to see what the breakpoint is at the site where you make the breakpoint.  So I switched
it back to -p but specified the source file as well, which is an "all within lldb" way of doing
what Pavel's fix did.

llvm-svn: 257235
2016-01-09 00:08:16 +00:00
Jim Ingham 7831c3590c Fix a thinko in the asserts in GetDynamicTypeAndAddress. It was requiring that the
process in the incoming value be non-null, but Value Objects created off the target
don't necessarily have a process.  In that case, having the targets the same is good
enough.

<rdar://problem/24097805>

llvm-svn: 257234
2016-01-08 23:44:51 +00:00
Jason Molenda 0c015c6279 In the questionmark packet ("T"), print the "threads:" and "thread-pcs:"
keys before we print the libdispatch queues keys (qname, qkind, qserialnum)
to make it easier to read the packet by hand.  No function difference, just
reordering the keys in the output.

llvm-svn: 257229
2016-01-08 23:16:03 +00:00
Ying Chen d7a2ecb681 Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
- fix buildbot breakage after r257186
- move declaration outside of for loop

llvm-svn: 257228
2016-01-08 23:10:56 +00:00
Zachary Turner c29de82956 Remove XFAIL from a few tests that have been fixed on Windows.
llvm-svn: 257219
2016-01-08 22:21:40 +00:00
Jason Molenda fd4cea53d5 Re-apply r257117 (reverted in r257138 temporarily),
with the one change that ThreadPlanStepOut::ThreadPlanStepOut
will now only advance the return address breakpoint to
the end of a source line, if we have source line debug information.
It will not advance to the end of a Symbol if we lack source line
information.  This, or the recognition of the LEAVE instruction
in r257209, would have fixed the regression that Siva was seeing.
Both were good changes, so I've made both.

Original commit message:

Performance improvement: Change lldb so that it puts a breakpoint
on the first branch instruction after a function return (or the end
of a source line), instead of a breakpoint on the return address,
to skip an extra stop & start of the inferior process.

I changed Process::AdvanceAddressToNextBranchInstruction to not
take an optional InstructionList argument - no callers are providing
a cached InstructionList today, and if this function was going to
do that, the right thing to do would be to fill out / use a
DisassemblerSP which is a disassembler with the InstructionList for
this address range.


http://reviews.llvm.org/D15708
<rdar://problem/23309838> 

llvm-svn: 257210
2016-01-08 21:40:11 +00:00
Jason Molenda dae3c57189 Add support for the LEAVE x86 instruction to AssemblyParse_x86.
llvm-svn: 257209
2016-01-08 21:13:26 +00:00
Zachary Turner 256c457170 XFAIL 2 more tests based on SWIG version.
There's a bug in versions of SWIG prior to 3.0.8 that prevent
these tests from succeeding with Python 3.x

llvm-svn: 257208
2016-01-08 21:08:24 +00:00
Zachary Turner cb0c122ed7 Remove XFAIL from TestThreadStates on Windows.
llvm-svn: 257207
2016-01-08 21:08:19 +00:00
Stephane Sezer 728384a05e Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
Summary:
When we construct AppleObjCTrampolineHandler, if m_impl_fn_addr is
invalid, we call CanJIT(). If the gdb remote process does not support
allocating and deallocating memory, this call stack will include a call
to the AppleObjCRuntime constructor. The AppleObjCRuntime constructor
will then call the AppleObjCTrampolineHandler constructor, creating a
recursive call loop that eventually overflows the stack and segfaults.

Avoid this call loop by not constructing the AppleObjCTrampolineHandler
within AppleObjCRuntime until we actually need to use it.

Reviewers: clayborg, jingham

Subscribers: sas, lldb-commits

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 257204
2016-01-08 20:32:35 +00:00
Justin Lebar dc3ad6fc1c Add note about the "thread until" command to the llvm-gdb cheatsheet.
Differential Revision: http://reviews.llvm.org/D15684

llvm-svn: 257189
2016-01-08 18:56:18 +00:00
Adrian McCarthy 6788b62f09 Treat an embedded int3/__debugbreak() as a breakpoint on Windows, includes a cross-platform test.
llvm-svn: 257186
2016-01-08 18:28:03 +00:00
Pavel Labath 0573159b84 Fix TestBatchMode for gcc
gcc by default does not accept for loop declarations in C files (one must choose C99 mode first,
which we don't). Place the declaration outside the loop, to make this code more conformant.

llvm-svn: 257166
2016-01-08 11:23:21 +00:00
Pavel Labath fa42a83773 Another fix for TestBatchMode on linux
On locked down systems (such as our buildbot) one needs to do a special dance to allow attaching
to processes. This commit adds this code to the TestBatchMode inferior.

llvm-svn: 257165
2016-01-08 11:16:45 +00:00
Pavel Labath eceec6dd01 Fix TestBatchMode on linux
New test introduced in r257120 was failing on linux. The reason for that the regex for setting
the breakpoint was being applied to the "default file", which in this case was the asm file
containing the definition of the sleep() syscall (because after attach, we are stopped in the
sleep function). I have changed this use the more customary way of setting the breakpoint and
specifying the source file name explicitly.

llvm-svn: 257160
2016-01-08 10:38:20 +00:00
Jason Molenda 7cb9d98cf9 Revert r257117 "Performance improvement: Change lldb so that it
puts a breakpoint" it is causing a regression in the TestStepNoDebug
test case on ubuntu 14.04 with gcc 4.9.2.  Thanks for the email
Siva.  I'll recommit when I've figured out the regression.

llvm-svn: 257138
2016-01-08 02:26:03 +00:00
Stephane Sezer 506ecac085 Fix dwarf sequence insertions
Summary:
If two dwarf sequences begin with entries that have identical addresses,
it is possible for the comparator to order the first entry of the new
sequence between the first and second entries of the existing sequence.

This will result in an attempted insertion of the second sequence inside
of the first sequence, which is invalid.

Ensure that insertions only occur in between existing sequences.

Reviewers: andrew.w.kaylor, clayborg

Subscribers: sas, lldb-commits

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 257132
2016-01-08 01:39:14 +00:00
Jason Molenda 26d84e8097 Change the key name for the libdispatch queue serial number from
"qserial" to "qserialnum" because "qserial" looks a lot like the
queue type (either 'serial' or 'concurrent') and can be confusing
to read through.  debugserver passes these up either in the questionmark
("T") packet, or in the response to the jThreadsInfo packet.

llvm-svn: 257121
2016-01-08 00:20:48 +00:00
Jim Ingham 962260c852 Fix a glitch in the Driver's batch mode when used with "attach".
Batch mode is supposed to stop execution and return control to the user when an
exceptional stop occurs (crash, signal or instrumentation).  But attach always stops
with a SIGSTOP on OSX (maybe on Linux too?) which would short circuit the rest of the
commands given.

This change allows a command result object to indicate that it expected to leave the 
process stopped with an exceptional stop reason, and it is okay for batch mode to keep going.

<rdar://problem/22243143>

llvm-svn: 257120
2016-01-08 00:20:47 +00:00
Jason Molenda b4a8b4c401 Performance improvement: Change lldb so that it puts a breakpoint
on the first branch instruction after a function return (or the end
of a source line), instead of a breakpoint on the return address,
to skip an extra stop & start of the inferior process.

I changed Process::AdvanceAddressToNextBranchInstruction to not
take an optional InstructionList argument - no callers are providing
a cached InstructionList today, and if this function was going to
do that, the right thing to do would be to fill out / use a
DisassemblerSP which is a disassembler with the InstructionList for
this address range.


http://reviews.llvm.org/D15708
<rdar://problem/23309838> 

llvm-svn: 257117
2016-01-08 00:06:03 +00:00
Stephane Sezer 6f45529046 Make sure we don't send qModuleInfo packets unnecessarily.
Summary:
Some debug servers don't support it so there's no point in spamming
this.

Reviewers: clayborg

Subscribers: fjricci, lldb-commits

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

llvm-svn: 257116
2016-01-08 00:00:17 +00:00
Siva Chandra 9293fc4185 Better scheme to lookup alternate mangled name when looking up function address.
Summary:
This change is relevant for inferiors compiled with GCC. GCC does not
emit complete debug info for std::basic_string<...>, and consequently, Clang
(the LLDB compiler) does not generate correct mangled names for certain
functions.

This change removes the hard-coded alternate names in
ItaniumABILanguageRuntime.cpp.

Before the hard-coded names were put in ItaniumABILanguageRuntime.cpp, one could
not evaluate std::string methods (ex. std::string::length). After putting in
the hard-coded names, one could evaluate them. However, it did not still
enable one to call methods on, say for example, std::vector<string>.
This change makes that possible.

There is some amount of incompleteness in this change. Consider the
following example:

std::string hello("hello"), world("world");
std::map<std::string, std::string> m;
m[hello] = world;

One can still not evaluate the expression "m[hello]" in LLDB. Will
address this issue in another pass.

Reviewers: jingham, vharron, evgeny777, spyffe, dawn

Subscribers: clayborg, dawn, lldb-commits

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

llvm-svn: 257113
2016-01-07 23:32:34 +00:00
Pavel Labath f6d9db4ae8 XFAIL TestMultithreaded on linux
Test sometimes fails even during the reruns, upgrading to xflaky to xfail.

llvm-svn: 257068
2016-01-07 15:24:51 +00:00
Ewan Crawford 9272a1c5a2 Remove duplicate header added in r256927
r256927 included a duplicate StreamString header file. This patch simply removes the duplicate.

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D15948

llvm-svn: 257061
2016-01-07 14:34:52 +00:00
Pavel Labath a203b6eb28 Remove some Windows->Android XTIMEOUTs
llvm-svn: 257052
2016-01-07 11:16:30 +00:00
Pavel Labath b08f8db32d XFAIL TestEvents.test_add_listener_to_broadcaster
Upgrade flaky to xfail, as the test sometimes fails even during the rerun.

llvm-svn: 257050
2016-01-07 10:53:40 +00:00
Ewan Crawford 26e52a7074 [RenderScript] Improve file format for saving RS allocations
Updates the file format for storing RS allocations to a file, so that the format now supports struct element types.

The file header will now contain a subheader for every RS element and it's descendants. 
Where an element subheader contains element type details and offsets to the subheaders of that elements fields. 

Patch also improves robustness when loading incorrect files.

llvm-svn: 257045
2016-01-07 10:19:09 +00:00
Todd Fiala d9be753049 fixup lldbinline-style tests to clean up Makefiles and *.d files
The lldbinline inline-test mechanism will create a Makefile
if one does not exist in the test directory.  This Makefile
and its *.d files were not getting cleaned up after a test run,
leaving trash in the source tree.

llvm-svn: 256961
2016-01-06 19:16:45 +00:00
Aidan Dodds 35e7b1ad2d [Renderscript] Fix stack argument inspection.
Function arguments that were spilled and passed on the stack were incorrectly read.
The value was written back into the output pointer rather then the memory being pointed to.

llvm-svn: 256941
2016-01-06 15:43:52 +00:00
Pavel Labath b5846ce715 Remove XTIMEOUT from TestMultithreaded on linux
instead, mark the test as expected flaky, which will trigger a rerun in case the test hangs.

llvm-svn: 256935
2016-01-06 14:15:32 +00:00