Commit Graph

14892 Commits

Author SHA1 Message Date
Ed Maste 0767b40e25 elf-core: set powerpc vector byte order correctly
It was being set to the fp reg set's byte order due to an apparent
copy-and-pasteo.                                                   

llvm-svn: 278625
2016-08-14 11:30:11 +00:00
Todd Fiala af32ccb195 fix lldb-gtest target of Xcode build
Change r278527 was filtering out too many libraries.
The Xcode lldb-gtest target depends on linking libgtest*.a,
but those were not being included.  This caused the lldb-gtest
linkage step to fail to find a main entry point that is present
in the filtered out libs.

This change restores the libgtest* libraries to the link list
by whitelisting them in the filter.

llvm-svn: 278552
2016-08-12 19:27:05 +00:00
Zachary Turner b6958a888e Disable TestThreadSpecificBpPlusCondition on Windows.
Test frequently times out stalling the test runner.

llvm-svn: 278529
2016-08-12 17:15:38 +00:00
Todd Fiala 1dc065b659 Link LLDB only against libclang and libLLVM .a files to fix macOS build
The Xcode macOS build of LLDB is currently broken after
https://reviews.llvm.org/D23232 landed, see
http://lab.llvm.org:8080/green/job/lldb_build_test/20014/console,
because we’re trying to link against all .a files found in the
llvm-build/lib directory. Let’s be more specific in what we link
against. This patch applies a regexp to only use “libclang.*”,
“libLLVM.*” and not “libclang_rt.*” static archives.

Change by Kuba Mracek (formerly Kuba Brecka)

See review here:
https://reviews.llvm.org/D23444

Reviewers: tfiala, compnerd
llvm-svn: 278527
2016-08-12 17:01:19 +00:00
Zachary Turner bd22bf26cb Fix build on Windows.
llvm-svn: 278526
2016-08-12 16:52:31 +00:00
Greg Clayton c6c420fca1 Switch over to using socketpair for local debugserver connections as they are twice as fast as TCP sockets (on macOS at least).
This change opens a socket pair and passes the second socket pair file descriptor down to the debugserver binary using a new option: "--fd=N" where N is the file descriptor. This file descriptor gets passed via posix_spawn() so that there is no need to do any bind/listen or bind/accept calls and eliminates the hanshake unix socket that is used to pass the result of the actual port that ends up being used so it can save time on launch as well as being faster.

This is currently only enabled on __APPLE__ builds. Other OSs should try modifying the #define from ProcessGDBRemote.cpp but the first person will need to port the --fd option over to lldb-server. Any OSs that enable USE_SOCKETPAIR_FOR_LOCAL_CONNECTION in their native builds can use the socket pair stuff. The #define is Apple only right now, but looks like:

#if defined (__APPLE__)
#define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1
#endif

<rdar://problem/27814880> 

llvm-svn: 278524
2016-08-12 16:46:18 +00:00
Tamas Berghammer 3785393def Skip 2 android test what is broken because of debuggerd
debuggerd is a crash reporting system on android what installs some
signal handler for SEGV to print a backtrace in the log. Its behavior
breaks tests where the test tries to continue after a SEGV so we skip
them as this behavior isn't required on android anyway.

llvm-svn: 278510
2016-08-12 14:17:05 +00:00
Pavel Labath fdb2d99eaf Fix-up r278299 for windows
FD_SETSIZE on windows limits the number of file descriptors, rather than their individual
magnitude (the underlying implementation uses an array rather than a bitset). This meant that the
assert in the SelectHelper was incorrect, and failing all the time. Fix that.

I am not sure whether this should be #ifdef MSVC, or #ifdef WINDOWS, but my feeling is that a
more posix-conforming implementation on windows would choose the bitset implementation, so I'm
sticking with the former.

llvm-svn: 278500
2016-08-12 11:20:21 +00:00
Pavel Labath 709269153f XFAIL TestNamespaceDefinitions on gcc-4.8 and below
llvm-svn: 278491
2016-08-12 09:52:14 +00:00
Pavel Labath b491ef4317 Make TestCallStopAndContinue clang-format-resilient
llvm-svn: 278490
2016-08-12 09:39:22 +00:00
Todd Fiala e1cfbc7942 Decoupled Options from CommandInterpreter.
Options used to store a reference to the CommandInterpreter instance
in the base Options class.  This made it impossible to parse options
independent of a CommandInterpreter.

This change removes the reference from the base class.  Instead, it
modifies the options-parsing-related methods to take an
ExecutionContext pointer, which the options may inspect if they need
to do so.

Closes https://reviews.llvm.org/D23416
Reviewers: clayborg, jingham

llvm-svn: 278440
2016-08-11 23:51:28 +00:00
Zachary Turner fd34ba53e3 Modify coding conventions to mention include ordering.
llvm-svn: 278373
2016-08-11 18:10:40 +00:00
Vedant Kumar 1c23c14808 [InstrumentationRuntime] Refactor the API (Part 2/N) (NFCI)
Factor out some common logic used to find the runtime library in a list
of modules.

Differential Revision: https://reviews.llvm.org/D23150

llvm-svn: 278368
2016-08-11 17:28:37 +00:00
Vedant Kumar a4fa2e299a [InstrumentationRuntime] Refactor the API (Part 1/N) (NFCI)
Adapters for instrumentation runtimes have to do two basic things:

  1) Load a runtime library.
  2) Install breakpoints in that library.

This logic is duplicated in the adapters for asan and tsan. Factor it
out and document bits of it to make it easier to add new adapters.

I tested this with check-lldb, and double-checked
testcases/functionalities/{a,t}san.

Differential Revision: https://reviews.llvm.org/D23043

llvm-svn: 278367
2016-08-11 17:28:33 +00:00
Pavel Labath 8c68837df3 Fix unit tests on windows
Python headers need to be included before PosixApi.h

llvm-svn: 278345
2016-08-11 15:31:30 +00:00
Pavel Labath 9ba9dfdd02 Make sure files include what they use (part 2/2)
This makes lldb still compile on linux after a project-wide clang-format

llvm-svn: 278335
2016-08-11 14:12:10 +00:00
Omair Javaid 3add5ec690 Make sure LldbGdbServerTestCase is built in arm mode to avoid failures due thumb instructions
Differential revision: https://reviews.llvm.org/D23395

llvm-svn: 278326
2016-08-11 10:35:05 +00:00
Pavel Labath 4dbab21354 Remove a double send of eRunPacketSent event
I accidentaly added the send both to the base class and the derived class in my refactor. Fix
that.

llvm-svn: 278325
2016-08-11 09:22:22 +00:00
Jim Ingham cec435fe75 dlopen & dlclose can't throw C++ or ObjC exceptions, so don't do the extra work of
setting & deleting the breakpoints to watch for this.

<rdar://problem/27780214>

llvm-svn: 278305
2016-08-11 00:15:28 +00:00
Greg Clayton 008ec44644 Fix a problem where if a uint64_t value is placed into a python dictionary and sent up to LLDB and converted to StructuredData, it would not be able to parse the full 64 bit value. A number like 0xf000000000000000L could be placed into a dictionary, and sent to LLDB and it would end up being 0xffffffffffffffff since it would overflow a int64_t. We leave the old code there, but if it overflows, we treat the number like a uint64_t and get it to decode correctly. Added a gtest to cover this so we don't regress. I verified the gtest failed prior to the fix, and it succeeds after it.
<rdar://problem/27409265>

llvm-svn: 278304
2016-08-10 23:25:57 +00:00
Greg Clayton 1ae68cdee7 Make pascal debugging work again.
<rdar://problem/27652051>

llvm-svn: 278302
2016-08-10 22:55:26 +00:00
Greg Clayton ee1f578d62 Centralize all select() calls into one place so that we can take advantage of system specific optimizations to deal with more file descriptors than FD_SETSIZE on some systems.
<rdar://problem/25325383>
https://reviews.llvm.org/D22950

llvm-svn: 278299
2016-08-10 22:43:48 +00:00
Todd Fiala c8b3717344 xfailed TestObjCNewSyntax.py on macOS for gmodules
Tracked by:
rdar://27792848

llvm-svn: 278289
2016-08-10 21:07:48 +00:00
Greg Clayton 649da6d623 Fix the lookup of dictionary values by name to not do a linear search.
llvm-svn: 278286
2016-08-10 20:37:45 +00:00
Zachary Turner d00efc6795 Remove a circular include dependency.
lldb-private-interfaces.h included lldb-private.h, and
lldb-private.h included lldb-private-interfaces.h.

llvm-svn: 278253
2016-08-10 17:59:03 +00:00
Pavel Labath dc2b3b7ea8 Make sure files include what they use (part 1/N)
preparation for the big clang-format.

llvm-svn: 278222
2016-08-10 13:30:20 +00:00
Todd Fiala 0711416b47 Undid LLVM macro usage in test suite test subject files.
llvm-svn: 278197
2016-08-10 01:37:27 +00:00
Todd Fiala abd6186216 Undo usage of LLVM macros in debugserver
We don't take a dependency on LLVM in debugserver.
This was failing to compile before.

llvm-svn: 278190
2016-08-10 00:53:21 +00:00
Jim Ingham 21db1ec221 Add a newline to the end of the file to remove the clang warnings.
llvm-svn: 278188
2016-08-10 00:45:58 +00:00
Zachary Turner 1c06bb107b Fix build on android and Linux.
gettimeofday() isn't defined without a special header.  Rather
than rely on C apis, let's just use modern C++11 to do this
portably on all platforms using std::chrono.

llvm-svn: 278182
2016-08-10 00:02:58 +00:00
Zachary Turner f343968f5d Delete Host/windows/win32.h
It's always hard to remember when to include this file, and
when you do include it it's hard to remember what preprocessor
check it needs to be behind, and then you further have to remember
whether it's windows.h or win32.h which you need to include.

This patch changes the name to PosixApi.h, which is more appropriately
named, and makes it independent of any preprocessor setting.

There's still the issue of people not knowing when to include this,
because there's not a well-defined set of things it exposes other
than "whatever is missing on Windows", but at least this should
make it less painful to fix when problems arise.

This patch depends on LLVM revision r278170.

llvm-svn: 278177
2016-08-09 23:06:08 +00:00
Enrico Granata 0a328c5f30 Adjust LLDB's iOS simulator interface for changes in CoreSimulator
rdar://27732333 and rdar://27732377

llvm-svn: 278166
2016-08-09 21:16:58 +00:00
Enrico Granata 85449e8517 Remove CFData from the xcodeproj as well
llvm-svn: 278158
2016-08-09 20:32:42 +00:00
Vedant Kumar 08b1dce670 [debugserver] Delete CFData.{h,cpp}, since they appear to be dead (NFCI)
Differential Revision: https://reviews.llvm.org/D23070

llvm-svn: 278142
2016-08-09 17:42:11 +00:00
Pavel Labath 8c1b6bd7d2 Reapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"
Resumbitting the commit after fixing the following problems:
- broken unit tests on windows: incorrect gtest usage on my part (TEST vs. TEST_F)
- the new code did not correctly handle the case where we went to interrupt the process, but it
  stopped due to a different reason - the interrupt request would remain queued and would
  interfere with the following "continue". I also added a unit test for this case.

This reapplies r277156 and r277139.

llvm-svn: 278118
2016-08-09 12:04:46 +00:00
Greg Clayton 30a3d8e402 Garbage collection is not around anymore, we can remove our support for it.
llvm-svn: 278064
2016-08-08 22:48:57 +00:00
Greg Clayton 5b22f4a6f7 Fix more RegisterInfo initialization issues and quiet hundreds of warnings.
llvm-svn: 278063
2016-08-08 22:48:07 +00:00
Greg Clayton 52930b5f4a Fix printf warnings.
llvm-svn: 278061
2016-08-08 22:16:03 +00:00
Greg Clayton 1386c6ceae Fix RegisterInfo initializers to have all the required initializers after recent changes. This quiets a few hundred warnings on MacOSX.
llvm-svn: 278060
2016-08-08 22:15:35 +00:00
Pavel Labath 142f4f76be Fix uninitialized field warnings in GDBRemoteRegisterContext
also take the opportunity to replace NULL with nullptr and add clang-format guards to prevent it
from messing up the nice table there.

llvm-svn: 278005
2016-08-08 13:38:33 +00:00
Pavel Labath 4ec22ec6b1 Clean up linux/Ptrace.h
This removes references to PT_XXX macros from the file, as they were not used anyway. It also
changes the macro used to check for the definition of __ptrace_request, as there are other C
libraries which do not define this type.

llvm-svn: 278001
2016-08-08 13:13:03 +00:00
Pavel Labath 1eb0d42a1b Remove Android.h
It only contained a reimplementation of std::to_string, which I have replaced with usages of
pre-existing llvm::to_string (also, injecting members into the std namespace is evil).

llvm-svn: 278000
2016-08-08 12:54:36 +00:00
Pavel Labath c923a3dc00 Remove SYS_tgkill from Android.h
instead, use __NR_tgkill directly, which seems to be the preferred form in the codebase anyway.

llvm-svn: 277999
2016-08-08 12:40:11 +00:00
Pavel Labath 6b73456865 Remove _isatty from Android.h
it is just #defined to isatty anyway, which lldb already knows how to use.

llvm-svn: 277997
2016-08-08 12:26:57 +00:00
Enrico Granata 0765abf772 The lack of classes in the hash table is not an error - it's very legitimately possible for a process to define no ObjC classes of its own. Discovered by debugging /bin/ls
llvm-svn: 277897
2016-08-06 00:57:07 +00:00
Oleksiy Vyalov 000ca1850d Fix Windows build - add return statement in SBThread::StepUsingScriptedThreadPlan.
llvm-svn: 277895
2016-08-06 00:42:23 +00:00
Jim Ingham bbe3288b06 Mention the scripted thread plans in the python reference.
llvm-svn: 277890
2016-08-05 23:35:26 +00:00
Jim Ingham fd0dbab248 Mention is_stale in the scripted step doc.
llvm-svn: 277884
2016-08-05 22:47:43 +00:00
Jim Ingham c915a7d2e8 Add a few more needed bits to the scripted thread plans.
llvm-svn: 277879
2016-08-05 22:06:12 +00:00
Enrico Granata 0f4f0c5d53 Tweaks to the reporting of "missing dyld shared cached" that make it easier to grab logs when such issues occur, make the logs more helpful, and also tweaks to the user messaging to make it easier to pinpoint an investigation avenue early on
llvm-svn: 277844
2016-08-05 18:09:50 +00:00